tensorflow
tensorflow copied to clipboard
Minor doc issue - Param order in nce_loss in word2vec tutorial
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().
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)