Skip to content

Commit 76cf35d

Browse files
authored
Add named arguments to tf.concat and use conv2d instead of convolution2d
1 parent 514a10d commit 76cf35d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adversarial_crypto/train_eval.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ def model(self, collection, message, key=None):
128128
"""
129129

130130
if key is not None:
131-
combined_message = tf.concat([message, key], 1)
131+
combined_message = tf.concat(axis=1, values=[message, key])
132132
else:
133133
combined_message = message
134134

135135
# Ensure that all variables created are in the specified collection.
136136
with tf.contrib.framework.arg_scope(
137-
[tf.contrib.layers.fully_connected, tf.contrib.layers.convolution2d],
137+
[tf.contrib.layers.fully_connected, tf.contrib.layers.conv2d],
138138
variables_collections=[collection]):
139139

140140
fc = tf.contrib.layers.fully_connected(
@@ -147,13 +147,13 @@ def model(self, collection, message, key=None):
147147
# and then squeezing it back down).
148148
fc = tf.expand_dims(fc, 2)
149149
# 2,1 -> 1,2
150-
conv = tf.contrib.layers.convolution2d(
150+
conv = tf.contrib.layers.conv2d(
151151
fc, 2, 2, 2, 'SAME', activation_fn=tf.nn.sigmoid)
152152
# 1,2 -> 1, 2
153-
conv = tf.contrib.layers.convolution2d(
153+
conv = tf.contrib.layers.conv2d(
154154
conv, 2, 1, 1, 'SAME', activation_fn=tf.nn.sigmoid)
155155
# 1,2 -> 1, 1
156-
conv = tf.contrib.layers.convolution2d(
156+
conv = tf.contrib.layers.conv2d(
157157
conv, 1, 1, 1, 'SAME', activation_fn=tf.nn.tanh)
158158
conv = tf.squeeze(conv, 2)
159159
return conv

0 commit comments

Comments
 (0)