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
0783f1cf
Unverified
Commit
0783f1cf
authored
Sep 02, 2018
by
Joel Shor
Committed by
GitHub
Sep 02, 2018
Browse files
Merge pull request #5227 from mikaelsouza/adding-fuse-batch-norm-parameter
Added fused_batch_norm parameter
parents
23b5b422
84577d6d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
research/gan/cifar/networks.py
research/gan/cifar/networks.py
+4
-4
No files found.
research/gan/cifar/networks.py
View file @
0783f1cf
...
...
@@ -46,7 +46,7 @@ def generator(noise, is_training=True):
Returns:
A single Tensor with a batch of generated CIFAR images.
"""
images
,
_
=
dcgan
.
generator
(
noise
,
is_training
=
is_training
)
images
,
_
=
dcgan
.
generator
(
noise
,
is_training
=
is_training
,
fused_batch_norm
=
True
)
# Make sure output lies between [-1, 1].
return
tf
.
tanh
(
images
)
...
...
@@ -68,7 +68,7 @@ def conditional_generator(inputs, is_training=True):
noise
,
one_hot_labels
=
inputs
noise
=
tfgan
.
features
.
condition_tensor_from_onehot
(
noise
,
one_hot_labels
)
images
,
_
=
dcgan
.
generator
(
noise
,
is_training
=
is_training
)
images
,
_
=
dcgan
.
generator
(
noise
,
is_training
=
is_training
,
fused_batch_norm
=
True
)
# Make sure output lies between [-1, 1].
return
tf
.
tanh
(
images
)
...
...
@@ -94,7 +94,7 @@ def discriminator(img, unused_conditioning, is_training=True):
images are real. The output can lie in [-inf, inf], with positive values
indicating high confidence that the images are real.
"""
logits
,
_
=
dcgan
.
discriminator
(
img
,
is_training
=
is_training
)
logits
,
_
=
dcgan
.
discriminator
(
img
,
is_training
=
is_training
,
fused_batch_norm
=
True
)
return
logits
...
...
@@ -118,7 +118,7 @@ def conditional_discriminator(img, conditioning, is_training=True):
images are real. The output can lie in [-inf, inf], with positive values
indicating high confidence that the images are real.
"""
logits
,
end_points
=
dcgan
.
discriminator
(
img
,
is_training
=
is_training
)
logits
,
end_points
=
dcgan
.
discriminator
(
img
,
is_training
=
is_training
,
fused_batch_norm
=
True
)
# Condition the last convolution layer.
_
,
one_hot_labels
=
conditioning
...
...
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