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
e4cbe9ee
"git@developer.sourcefind.cn:OpenDAS/mmdetection3d.git" did not exist on "fd3112bc4954071456660dbb3904a6c9b7a54d86"
Commit
e4cbe9ee
authored
Mar 22, 2017
by
Neal Wu
Browse files
Fix the argument order for tf.nn.sampled_softmax_loss in textsum
parent
dcb49d91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
textsum/seq2seq_attention_model.py
textsum/seq2seq_attention_model.py
+3
-2
No files found.
textsum/seq2seq_attention_model.py
View file @
e4cbe9ee
...
@@ -227,8 +227,9 @@ class Seq2SeqAttentionModel(object):
...
@@ -227,8 +227,9 @@ class Seq2SeqAttentionModel(object):
def
sampled_loss_func
(
inputs
,
labels
):
def
sampled_loss_func
(
inputs
,
labels
):
with
tf
.
device
(
'/cpu:0'
):
# Try gpu.
with
tf
.
device
(
'/cpu:0'
):
# Try gpu.
labels
=
tf
.
reshape
(
labels
,
[
-
1
,
1
])
labels
=
tf
.
reshape
(
labels
,
[
-
1
,
1
])
return
tf
.
nn
.
sampled_softmax_loss
(
w_t
,
v
,
inputs
,
labels
,
return
tf
.
nn
.
sampled_softmax_loss
(
hps
.
num_softmax_samples
,
vsize
)
weights
=
w_t
,
biases
=
v
,
labels
=
labels
,
inputs
=
inputs
,
num_sampled
=
hps
.
num_softmax_samples
,
num_classes
=
vsize
)
if
hps
.
num_softmax_samples
!=
0
and
hps
.
mode
==
'train'
:
if
hps
.
num_softmax_samples
!=
0
and
hps
.
mode
==
'train'
:
self
.
_loss
=
seq2seq_lib
.
sampled_sequence_loss
(
self
.
_loss
=
seq2seq_lib
.
sampled_sequence_loss
(
...
...
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