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
f7cea8d0
"vscode:/vscode.git/clone" did not exist on "709f842457f40550c88da80f84bc8d7ba29371b9"
Commit
f7cea8d0
authored
Mar 22, 2017
by
Neal Wu
Browse files
Rename sampled_loss argument inputs to logits in preparation for named arguments requirement
parent
e4cbe9ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tutorials/rnn/translate/seq2seq_model.py
tutorials/rnn/translate/seq2seq_model.py
+2
-2
No files found.
tutorials/rnn/translate/seq2seq_model.py
View file @
f7cea8d0
...
...
@@ -100,13 +100,13 @@ class Seq2SeqModel(object):
b
=
tf
.
get_variable
(
"proj_b"
,
[
self
.
target_vocab_size
],
dtype
=
dtype
)
output_projection
=
(
w
,
b
)
def
sampled_loss
(
labels
,
inpu
ts
):
def
sampled_loss
(
labels
,
logi
ts
):
labels
=
tf
.
reshape
(
labels
,
[
-
1
,
1
])
# We need to compute the sampled_softmax_loss using 32bit floats to
# avoid numerical instabilities.
local_w_t
=
tf
.
cast
(
w_t
,
tf
.
float32
)
local_b
=
tf
.
cast
(
b
,
tf
.
float32
)
local_inputs
=
tf
.
cast
(
inpu
ts
,
tf
.
float32
)
local_inputs
=
tf
.
cast
(
logi
ts
,
tf
.
float32
)
return
tf
.
cast
(
tf
.
nn
.
sampled_softmax_loss
(
weights
=
local_w_t
,
...
...
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