chiphuyen / stanford-tensorflow-tutorials

This repository contains code examples for the Stanford's course: TensorFlow for Deep Learning Research.
http://cs20.stanford.edu
MIT License
10.32k stars 4.32k forks source link

tensorflow sampled softmax loss #147

Closed adrienmialland closed 5 years ago

adrienmialland commented 5 years ago

I am using tf.sampled_softmax_loss in a RNN for translation from english to french. This is usefull to speed up the training but, is it possible to get the prediction of the samples used by tf.sampled_softmax_loss ?

I'd like to be able to compute the accuracy.

Indeed, what I understand is that tf.sampled_softmax_loss acte like a final layer that output all the logits for all the required class, and then apply the sampled algrithm to proccess a "smaller" softmax. But, I can't directly access, at least, the logits.