graykode / graykode/nlp-tutorial

about skip-gram code

Open
#32 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
14.9k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

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()`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.