Commit 320be60b authored by Richard Davies's avatar Richard Davies
Browse files

Force new instance creation in MultiRNNCell

parent 71bf3d47
...@@ -478,8 +478,10 @@ class NeuralGPU(object): ...@@ -478,8 +478,10 @@ class NeuralGPU(object):
# This is just for running a baseline RNN seq2seq model. # This is just for running a baseline RNN seq2seq model.
if do_rnn: if do_rnn:
self.after_enc_step.append(step) # Not meaningful here, but needed. self.after_enc_step.append(step) # Not meaningful here, but needed.
lstm_cell = tf.contrib.rnn.BasicLSTMCell(height * nmaps) def lstm_cell():
cell = tf.contrib.rnn.MultiRNNCell([lstm_cell] * nconvs) return tf.contrib.rnn.BasicLSTMCell(height * nmaps)
cell = tf.contrib.rnn.MultiRNNCell(
[lstm_cell() for _ in range(nconvs)])
with tf.variable_scope("encoder"): with tf.variable_scope("encoder"):
encoder_outputs, encoder_state = tf.nn.dynamic_rnn( encoder_outputs, encoder_state = tf.nn.dynamic_rnn(
cell, tf.reshape(step, [batch_size, length, height * nmaps]), cell, tf.reshape(step, [batch_size, length, height * nmaps]),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment