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
6f38af5f
Commit
6f38af5f
authored
Jun 29, 2017
by
Ryan Sepassi
Committed by
GitHub
Jun 29, 2017
Browse files
Fix KL when num_classes != 2
Fix to [issue 1724](
https://github.com/tensorflow/models/issues/1724
)
parent
6685fb8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
adversarial_text/adversarial_losses.py
adversarial_text/adversarial_losses.py
+1
-0
No files found.
adversarial_text/adversarial_losses.py
View file @
6f38af5f
...
...
@@ -212,6 +212,7 @@ def _kl_divergence_with_logits(q_logits, p_logits, weights):
# For softmax regression
else
:
q
=
tf
.
nn
.
softmax
(
q_logits
)
kl
=
tf
.
reduce_sum
(
q
*
(
tf
.
nn
.
log_softmax
(
q_logits
)
-
tf
.
nn
.
log_softmax
(
p_logits
)),
1
)
...
...
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