我正在尝试重新实现这篇论文 Semantically Conditioned LSTM-based Natural Language Generation for Spoken Dialogue Systems ,其中他们向 LSTM 单元添加了一个门并改变了状态的计算方式。

我怎样才能在 tensorflow 中做到这一点?我需要添加一个新的 OP 吗?

最佳答案

tf.nn.rnn() tf.nn.dynamic_rnn() 函数接受 cell 类型的参数 tf.nn.rnn_cell.RNNCell 。例如,您可以查看 implementation of tf.nn.rnn_cell.BasicLSTMCell (特别是 BasicLSTMCell.__call__() method ),这可能是您自定义 LSTM 的一个很好的起点。

关于machine-learning - 如何在 tensorflow 中编写自定义的 LSTM?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38751084/

10-11 22:48
查看更多