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
2c4fea8d
Commit
2c4fea8d
authored
Jun 06, 2017
by
Neal Wu
Committed by
GitHub
Jun 06, 2017
Browse files
Merge pull request #1532 from andrewgilbert12/adversarial-crypto-bug-fix
Fixed calls to concat and convolution2d
parents
cfdbdf10
76cf35de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
adversarial_crypto/train_eval.py
adversarial_crypto/train_eval.py
+5
-5
No files found.
adversarial_crypto/train_eval.py
View file @
2c4fea8d
...
@@ -128,13 +128,13 @@ class AdversarialCrypto(object):
...
@@ -128,13 +128,13 @@ class AdversarialCrypto(object):
"""
"""
if
key
is
not
None
:
if
key
is
not
None
:
combined_message
=
tf
.
concat
(
1
,
[
message
,
key
])
combined_message
=
tf
.
concat
(
axis
=
1
,
values
=
[
message
,
key
])
else
:
else
:
combined_message
=
message
combined_message
=
message
# Ensure that all variables created are in the specified collection.
# Ensure that all variables created are in the specified collection.
with
tf
.
contrib
.
framework
.
arg_scope
(
with
tf
.
contrib
.
framework
.
arg_scope
(
[
tf
.
contrib
.
layers
.
fully_connected
,
tf
.
contrib
.
layers
.
conv
olution
],
[
tf
.
contrib
.
layers
.
fully_connected
,
tf
.
contrib
.
layers
.
conv
2d
],
variables_collections
=
[
collection
]):
variables_collections
=
[
collection
]):
fc
=
tf
.
contrib
.
layers
.
fully_connected
(
fc
=
tf
.
contrib
.
layers
.
fully_connected
(
...
@@ -147,13 +147,13 @@ class AdversarialCrypto(object):
...
@@ -147,13 +147,13 @@ class AdversarialCrypto(object):
# and then squeezing it back down).
# and then squeezing it back down).
fc
=
tf
.
expand_dims
(
fc
,
2
)
fc
=
tf
.
expand_dims
(
fc
,
2
)
# 2,1 -> 1,2
# 2,1 -> 1,2
conv
=
tf
.
contrib
.
layers
.
conv
olution
(
conv
=
tf
.
contrib
.
layers
.
conv
2d
(
fc
,
2
,
2
,
2
,
'SAME'
,
activation_fn
=
tf
.
nn
.
sigmoid
)
fc
,
2
,
2
,
2
,
'SAME'
,
activation_fn
=
tf
.
nn
.
sigmoid
)
# 1,2 -> 1, 2
# 1,2 -> 1, 2
conv
=
tf
.
contrib
.
layers
.
conv
olution
(
conv
=
tf
.
contrib
.
layers
.
conv
2d
(
conv
,
2
,
1
,
1
,
'SAME'
,
activation_fn
=
tf
.
nn
.
sigmoid
)
conv
,
2
,
1
,
1
,
'SAME'
,
activation_fn
=
tf
.
nn
.
sigmoid
)
# 1,2 -> 1, 1
# 1,2 -> 1, 1
conv
=
tf
.
contrib
.
layers
.
conv
olution
(
conv
=
tf
.
contrib
.
layers
.
conv
2d
(
conv
,
1
,
1
,
1
,
'SAME'
,
activation_fn
=
tf
.
nn
.
tanh
)
conv
,
1
,
1
,
1
,
'SAME'
,
activation_fn
=
tf
.
nn
.
tanh
)
conv
=
tf
.
squeeze
(
conv
,
2
)
conv
=
tf
.
squeeze
(
conv
,
2
)
return
conv
return
conv
...
...
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