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
4c21dfa8
Commit
4c21dfa8
authored
Feb 19, 2018
by
Andrew M. Dai
Browse files
Fix github issue #3269 where the accuracy is wrongly underestimated for binary classification.
PiperOrigin-RevId: 186265033
parent
af6527c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
research/adversarial_text/layers.py
research/adversarial_text/layers.py
+1
-1
No files found.
research/adversarial_text/layers.py
View file @
4c21dfa8
...
@@ -254,7 +254,7 @@ def predictions(logits):
...
@@ -254,7 +254,7 @@ def predictions(logits):
with
tf
.
name_scope
(
'predictions'
):
with
tf
.
name_scope
(
'predictions'
):
# For binary classification
# For binary classification
if
inner_dim
==
1
:
if
inner_dim
==
1
:
pred
=
tf
.
cast
(
tf
.
greater
(
tf
.
squeeze
(
logits
,
-
1
),
0.
5
),
tf
.
int64
)
pred
=
tf
.
cast
(
tf
.
greater
(
tf
.
squeeze
(
logits
,
-
1
),
0.
),
tf
.
int64
)
# For multi-class classification
# For multi-class classification
else
:
else
:
pred
=
tf
.
argmax
(
logits
,
2
)
pred
=
tf
.
argmax
(
logits
,
2
)
...
...
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