sampled_softmax_loss 对比负采样

sampled_softmax_loss vs negative sampling

我正在研究文本自动编码器,所以想使用负采样来训练我们的模型。我想知道negative sampling和sampled softmax的区别

提前致谢

https://www.tensorflow.org/extras/candidate_sampling.pdf

根据tensorflow,负采样与logistic loss相关,sampled softmax与softmax相关。

他们两者的核心是选择一个负样本样本来计算损失并更新梯度。

对于您的模型,如果您的输出非常大(很多 类)并且常规损失计算速度太慢,请使用它。如果输出很少 类 则收益不大。如果无论如何训练都很快,为什么还要费心去近似。