graykode / graykode/nlp-tutorial

about skip-gram code

未关闭
#32 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Jupyter Notebook
星标
14.9k
派生
3.9k
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

调研方向

先阅读 Word2Vec-Skipgram-Tensor(Softmax).py,并跟踪其中展示的训练循环,尤其是 random_batch、batch_inputs 和 batch_labels。然后检查 trained_embeddings = W.eval() 这一行;当这两个操作及其在循环中的用途都得到清晰解释时,该 issue 就得到解决。

由索引模型根据 Issue 内容生成。

评估

技术栈
tensorflow
领域
documentation, machine-learning
Issue 类型
文档
难度
1/5
预计耗时
1 小时以内
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。