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
26584e08
Unverified
Commit
26584e08
authored
Feb 05, 2018
by
Neal Wu
Committed by
GitHub
Feb 05, 2018
Browse files
Merge pull request #3325 from yanboliang/ptb-rnn
Fix wrong reference in ptb_word_lm.py
parents
42b3ab23
64e2ee78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
tutorials/rnn/ptb/ptb_word_lm.py
tutorials/rnn/ptb/ptb_word_lm.py
+5
-5
No files found.
tutorials/rnn/ptb/ptb_word_lm.py
View file @
26584e08
...
@@ -225,15 +225,15 @@ class PTBModel(object):
...
@@ -225,15 +225,15 @@ class PTBModel(object):
self
.
_initial_state
=
cell
.
zero_state
(
config
.
batch_size
,
data_type
())
self
.
_initial_state
=
cell
.
zero_state
(
config
.
batch_size
,
data_type
())
state
=
self
.
_initial_state
state
=
self
.
_initial_state
# Simplified version of t
ensorflow_models/tutorials/rnn/rnn.py's
rnn().
# Simplified version of t
f.nn.static_
rnn().
# This builds an unrolled LSTM for tutorial purposes only.
# This builds an unrolled LSTM for tutorial purposes only.
# In general, use t
he rnn() or
state_saving_rnn()
from rnn.py
.
# In general, use t
f.nn.static_rnn() or tf.nn.static_
state_saving_rnn().
#
#
# The alternative version of the code below is:
# The alternative version of the code below is:
#
#
# inputs = tf.unstack(inputs, num=num_steps, axis=1)
# inputs = tf.unstack(inputs, num=
self.
num_steps, axis=1)
# outputs, state = tf.
contrib.r
nn.static_rnn(cell, inputs,
# outputs, state = tf.nn.static_rnn(cell, inputs,
# initial_state=self._initial_state)
#
initial_state=self._initial_state)
outputs
=
[]
outputs
=
[]
with
tf
.
variable_scope
(
"RNN"
):
with
tf
.
variable_scope
(
"RNN"
):
for
time_step
in
range
(
self
.
num_steps
):
for
time_step
in
range
(
self
.
num_steps
):
...
...
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