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
d6787c0f
Commit
d6787c0f
authored
Mar 07, 2017
by
K. Nathaniel Tucker
Committed by
GitHub
Mar 07, 2017
Browse files
Update model.py
In response to reviewer's comments.
parent
b2a2f44b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
namignizer/model.py
namignizer/model.py
+8
-5
No files found.
namignizer/model.py
View file @
d6787c0f
...
@@ -37,11 +37,14 @@ class NamignizerModel(object):
...
@@ -37,11 +37,14 @@ class NamignizerModel(object):
self
.
_weights
=
tf
.
placeholder
(
tf
.
float32
,
[
batch_size
*
num_steps
])
self
.
_weights
=
tf
.
placeholder
(
tf
.
float32
,
[
batch_size
*
num_steps
])
# lstm for our RNN cell (GRU supported too)
# lstm for our RNN cell (GRU supported too)
lstm_cells
=
[]
for
layer
in
range
(
config
.
num_layers
):
lstm_cell
=
tf
.
contrib
.
rnn
.
BasicLSTMCell
(
size
,
forget_bias
=
0.0
)
lstm_cell
=
tf
.
contrib
.
rnn
.
BasicLSTMCell
(
size
,
forget_bias
=
0.0
)
if
is_training
and
config
.
keep_prob
<
1
:
if
is_training
and
config
.
keep_prob
<
1
:
lstm_cell
=
tf
.
contrib
.
rnn
.
DropoutWrapper
(
lstm_cell
=
tf
.
contrib
.
rnn
.
DropoutWrapper
(
lstm_cell
,
output_keep_prob
=
config
.
keep_prob
)
lstm_cell
,
output_keep_prob
=
config
.
keep_prob
)
cell
=
tf
.
contrib
.
rnn
.
MultiRNNCell
([
lstm_cell
]
*
config
.
num_layers
)
lstm_cells
.
append
(
lstm_cell
)
cell
=
tf
.
contrib
.
rnn
.
MultiRNNCell
(
lstm_cells
)
self
.
_initial_state
=
cell
.
zero_state
(
batch_size
,
tf
.
float32
)
self
.
_initial_state
=
cell
.
zero_state
(
batch_size
,
tf
.
float32
)
...
...
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