Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.tensorflow
Commits
9433478b
Commit
9433478b
authored
May 02, 2019
by
Amir MOHAMMADI
Browse files
Compute VAT loss only during training.
parent
3bbc0005
Changes
1
Show whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/loss/vat.py
View file @
9433478b
...
...
@@ -103,6 +103,8 @@ class VATLoss:
NotImplementedError
If self.method is not ``vat`` or ``vatent``.
"""
if
mode
!=
tf
.
estimator
.
ModeKeys
.
TRAIN
:
return
0.
architecture
=
partial
(
architecture
,
reuse
=
True
)
with
tf
.
variable_scope
(
tf
.
get_variable_scope
(),
reuse
=
True
):
vat_loss
=
self
.
virtual_adversarial_loss
(
features
,
logits
,
architecture
,
mode
)
...
...
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