采样softmax张量流rnn歧义

时间:2018-10-24 09:53:33

标签: python tensorflow sampling rnn multiclass-classification

我已经在模型中实现了带有张量流的softmax采样示例,其中我试图使用具有500个类的多对一Rnn对句子进行分类。

我有3个无法在线找到答案的问题:

  1. 当类数为500时,是否值得使用采样的softmax?
  2. 我通常会看到两种在线实现它的方式,一种是它们引入了新的权重和偏差,它们专门用作函数tf.nn.sampled_softmax_loss的输入(例如在word2vec实现https://towardsdatascience.com/word2vec-skip-gram-model-part-2-implementation-in-tf-7efdf6f58a27中,也可以在此处https://chromium.googlesource.com/external/github.com/tensorflow/tensorflow/+/r0.8/tensorflow/g3doc/tutorials/seq2seq/index.md)。取而代之的是,在其他实现中,它们使用与矩阵乘法进行预测时使用的权重相同的权重(https://github.com/olirice/sampled_softmax_loss/blob/master/Sampled_Softmax_Loss.ipynbTensorflow Sampled Softmax Loss Correct Usage),正确的权重是多少,或者至少我该怎么做?
  3. 权重矩阵的转置,有些人转置,有些人没有,正确的方法是什么?

在此先感谢您的提示:)

0 个答案:

没有答案
相关问题