Commit f282f6ef authored by Alexander Gorban's avatar Alexander Gorban
Browse files

Merge branch 'master' of github.com:tensorflow/models

parents 58a5da7b a2970b03
This diff is collapsed.
# NeuralGPU # NeuralGPU
Code for the Neural GPU model described in [[http://arxiv.org/abs/1511.08228]]. Code for the Neural GPU model described in http://arxiv.org/abs/1511.08228.
The extended version was described in [[https://arxiv.org/abs/1610.08613]]. The extended version was described in https://arxiv.org/abs/1610.08613.
Requirements: Requirements:
* TensorFlow (see tensorflow.org for how to install) * TensorFlow (see tensorflow.org for how to install)
......
...@@ -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]),
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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