如何在 tensorflow 中编写自定义的 LSTM?
How to write a customized LSTM in tensorflow?
我正在尝试重新实现这篇论文 Semantically Conditioned LSTM-based Natural Language Generation for Spoken Dialogue Systems,他们在其中向 LSTM 单元添加了一个门并更改了状态的计算方式。
我如何在 tensorflow 中执行此操作?我需要添加新的 OP 吗?
tf.nn.rnn()
and tf.nn.dynamic_rnn()
functions accept an argument cell
of type tf.nn.rnn_cell.RNNCell
. For example you can take a look at the implementation of tf.nn.rnn_cell.BasicLSTMCell
(in particular the BasicLSTMCell.__call__()
method),这可能是您自定义 LSTM 的良好起点。
我正在尝试重新实现这篇论文 Semantically Conditioned LSTM-based Natural Language Generation for Spoken Dialogue Systems,他们在其中向 LSTM 单元添加了一个门并更改了状态的计算方式。
我如何在 tensorflow 中执行此操作?我需要添加新的 OP 吗?
tf.nn.rnn()
and tf.nn.dynamic_rnn()
functions accept an argument cell
of type tf.nn.rnn_cell.RNNCell
. For example you can take a look at the implementation of tf.nn.rnn_cell.BasicLSTMCell
(in particular the BasicLSTMCell.__call__()
method),这可能是您自定义 LSTM 的良好起点。