使用TensorFlow NCE_LOSS进行培训时如何进行预测
https://www.tensorflow.org/api_docs/python/tf/nn/ nce_loss 在这里,它说计算评估或推理的完整Sigmoid损失
,谁能解释一些详细信息如何在推理期间预测标签?
据我了解,模型的最后一层输出是形状(批处理,num_class),在训练期间,它直接陷入了NCE损失,并被视为二进制分类问题。在推断期间,我直接将Sigmoid在最后一层输出上进行并获取相应的条目表示类i
的概率是正确的吗?还是我可以将最大的入口视为类标签,就像使用SoftMax一样?
不太了解这一点,我也没有找到与此在线相关的任何实际示例。任何帮助都将受到赞赏!非常感谢!
https://www.tensorflow.org/api_docs/python/tf/nn/nce_loss
Here it says calculate the full sigmoid loss for evaluation or inference
, can anyone explain some detail how to predict the label in the inference period?
As I understand the model's last layer output is of shape (batch, num_class), during training it directly goes into nce loss and is treated as a binary classification problem. During inference, is it right that I directly take the sigmoid over the last layer output and get the corresponding entry i
to represent the probability of class i
? Or I can directly treat the largest entry as the class label just like using softmax?
Not quite understand this, neither have I found any practical example related to this online. Any help is appreciated! Thanks so much in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您考虑序列输入时,NCE_LOSS可能是噪声对抗性估计,它通过选择Acandidate采样器而变化以创建输出。
参考0: htttps:///www.tensorflow.orgg/api_orpi_orpi_docs/api_docs/python/python/ppython/tfff /nn/nce_loss
参考1: https://github.com/yl-1993/tensorflow/blob/master/master/tensorflow/examples/tutorials/mnist/mnist/mnist_deep.py.py.py
ref 2: https://www.progragramcreek.com/python/python/python/example/90447/90447/tensorflow.nce_loss.nce_loss.nce_loss
It is possible when you consider the sequence input, NCE_loss is the noise-contrastive estimation that varies input to create the output by selecting acandidate sampler.
Ref 0: https://www.tensorflow.org/api_docs/python/tf/nn/nce_loss
Ref 1: https://github.com/yl-1993/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_deep.py
Ref 2: https://www.programcreek.com/python/example/90447/tensorflow.nce_loss
[ Sample ]: