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
9b023de8
Commit
9b023de8
authored
Oct 31, 2016
by
Xin Pan
Committed by
GitHub
Oct 31, 2016
Browse files
Merge pull request #601 from panyx0718/master
Explicitly set state_is_tuple=False.
parents
1662e278
5e875226
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
textsum/seq2seq_attention_model.py
textsum/seq2seq_attention_model.py
+6
-3
No files found.
textsum/seq2seq_attention_model.py
View file @
9b023de8
...
@@ -160,10 +160,12 @@ class Seq2SeqAttentionModel(object):
...
@@ -160,10 +160,12 @@ class Seq2SeqAttentionModel(object):
self
.
_next_device
()):
self
.
_next_device
()):
cell_fw
=
tf
.
nn
.
rnn_cell
.
LSTMCell
(
cell_fw
=
tf
.
nn
.
rnn_cell
.
LSTMCell
(
hps
.
num_hidden
,
hps
.
num_hidden
,
initializer
=
tf
.
random_uniform_initializer
(
-
0.1
,
0.1
,
seed
=
123
))
initializer
=
tf
.
random_uniform_initializer
(
-
0.1
,
0.1
,
seed
=
123
),
state_is_tuple
=
False
)
cell_bw
=
tf
.
nn
.
rnn_cell
.
LSTMCell
(
cell_bw
=
tf
.
nn
.
rnn_cell
.
LSTMCell
(
hps
.
num_hidden
,
hps
.
num_hidden
,
initializer
=
tf
.
random_uniform_initializer
(
-
0.1
,
0.1
,
seed
=
113
))
initializer
=
tf
.
random_uniform_initializer
(
-
0.1
,
0.1
,
seed
=
113
),
state_is_tuple
=
False
)
(
emb_encoder_inputs
,
fw_state
,
_
)
=
tf
.
nn
.
bidirectional_rnn
(
(
emb_encoder_inputs
,
fw_state
,
_
)
=
tf
.
nn
.
bidirectional_rnn
(
cell_fw
,
cell_bw
,
emb_encoder_inputs
,
dtype
=
tf
.
float32
,
cell_fw
,
cell_bw
,
emb_encoder_inputs
,
dtype
=
tf
.
float32
,
sequence_length
=
article_lens
)
sequence_length
=
article_lens
)
...
@@ -188,7 +190,8 @@ class Seq2SeqAttentionModel(object):
...
@@ -188,7 +190,8 @@ class Seq2SeqAttentionModel(object):
cell
=
tf
.
nn
.
rnn_cell
.
LSTMCell
(
cell
=
tf
.
nn
.
rnn_cell
.
LSTMCell
(
hps
.
num_hidden
,
hps
.
num_hidden
,
initializer
=
tf
.
random_uniform_initializer
(
-
0.1
,
0.1
,
seed
=
113
))
initializer
=
tf
.
random_uniform_initializer
(
-
0.1
,
0.1
,
seed
=
113
),
state_is_tuple
=
False
)
encoder_outputs
=
[
tf
.
reshape
(
x
,
[
hps
.
batch_size
,
1
,
2
*
hps
.
num_hidden
])
encoder_outputs
=
[
tf
.
reshape
(
x
,
[
hps
.
batch_size
,
1
,
2
*
hps
.
num_hidden
])
for
x
in
encoder_outputs
]
for
x
in
encoder_outputs
]
...
...
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