tensorflow icon indicating copy to clipboard operation
tensorflow copied to clipboard

Minor doc issue - Param order in nce_loss in word2vec tutorial

Open BaiGang opened this issue 9 years ago • 1 comments

In section 'Building the graph' of g3doc/tutorials/word2vec/index.md:

# Compute the NCE loss, using a sample of the negative labels each time.
loss = tf.reduce_mean(
  tf.nn.nce_loss(nce_weights, nce_biases, embed, train_labels,
                 num_sampled, vocabulary_size))

Whereas the actual order of parameters is, as in python/ops/nn_impl.py, is defined as:

def nce_loss(weights,
             biases,
             labels,
             inputs,
             ....

So the embed and the train_labels parameters in the code excerpt in the word2vec tutorial page should be swapped to match the definition of tf.nn.nce_loss().

BaiGang avatar Jan 04 '17 01:01 BaiGang

Good catch. I have fixed this internally, but unclear when it will propagate out to the tensorflow website and to Github (we are changing some directory structures for docs so things may be weird for a little while)

dr4b avatar Feb 28 '17 00:02 dr4b