Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
320be60b
Commit
320be60b
authored
May 17, 2017
by
Richard Davies
Browse files
Force new instance creation in MultiRNNCell
parent
71bf3d47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
neural_gpu/neural_gpu.py
neural_gpu/neural_gpu.py
+4
-2
No files found.
neural_gpu/neural_gpu.py
View file @
320be60b
...
@@ -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
]),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment