关于seq2seq模型的最新Tensorflow api包含计划采样:
https://www.tensorflow.org/api_docs/python/tf/contrib/seq2seq/ScheduledEmbeddingTrainingHelperhttps://www.tensorflow.org/api_docs/python/tf/contrib/seq2seq/ScheduledOutputTrainingHelper
计划抽样的原始文件可以在这里找到: https://arxiv.org/abs/1506.03099
我读了这篇论文,但我不明白ScheduledEmbeddingTrainingHelper
和{ScheduledEmbeddingTrainingHelper
是一个培训助手,它添加了计划的采样,而{
我想知道这两个帮手有什么区别?在
我联系了幕后的工程师,他回答说:
这也可能对你有帮助。这种情况下,您希望在每个解码步骤分别进行定时采样。在
我使用tensorflow文档代码来创建这个示例。 https://github.com/tensorflow/tensorflow/blob/r1.5/tensorflow/contrib/seq2seq/python/ops/helper.py
下面是一个使用
ScheduledEmbeddingTrainingHelper
,使用tensorflow1.3和更高级别的基本示例tf.contrib公司原料药。这是一个sequence2sequence模型,其中解码器的初始隐藏状态是编码器的最终隐藏状态。它只展示了如何在单个批次上进行训练(显然,任务是“颠倒这个顺序”)。对于实际的训练任务,我建议tf.contrib.学习API,如learn\u runner、Experience和估算器. 在对于
^{pr2}$ScheduledOutputTrainingHelper
,我希望只交换助手并使用:但是这会产生一个错误,因为LSTM单元要求每个时间步都有一个多维输入(形状为(批处理大小,输入尺寸))。我将在GitHub中提出一个问题,以确定这是否是一个bug,或者有其他方法可以使用
ScheduledOutputTrainingHelper
。在相关问题 更多 >
编程相关推荐