The Wayback Machine - https://web.archive.org/web/20201012114300/https://github.com/graykode/nlp-tutorial/issues/32
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about skip-gram code #32

Open
tarogege opened this issue Jul 23, 2019 · 0 comments
Open

about skip-gram code #32

tarogege opened this issue Jul 23, 2019 · 0 comments

Comments

@tarogege
Copy link

@tarogege tarogege commented Jul 23, 2019

I don't quite understand that why 'batch_inputs', 'batch_labels' should be updated during each loop in Word2Vec-Skipgram-Tensor(Softmax).py .

Also ,what does 'trained_embeddings = W.eval()' mean?

Could you explain it for me?I am a bit confused.

`# code

for epoch in range(5000):
    batch_inputs, batch_labels = random_batch(skip_grams, batch_size)
    _, loss = sess.run([optimizer, cost], feed_dict={inputs: batch_inputs, labels: batch_labels})

    if (epoch + 1)%1000 == 0:
        print('Epoch:', '%04d' % (epoch + 1), 'cost =', '{:.6f}'.format(loss))

    trained_embeddings = W.eval()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.