Fix models in test_attacks.py that were ignoring h1 and incorrectly feeding x to softmax.
@@ -127,7 +127,7 @@ class TestFastGradientMethod(CleverHansTest):
W1 = tf.constant([[1.5, .3], [-2, 0.3]], dtype=tf.float32)
h1 = tf.nn.sigmoid(tf.matmul(x, W1))
W2 = tf.constant([[-2.4, 1.2], [0.5, -2.3]], dtype=tf.float32)
- res = tf.nn.softmax(tf.matmul(x, W2))
+ res = tf.nn.softmax(tf.matmul(h1, W2))
return res
self.sess = tf.Session()
@@ -234,7 +234,7 @@ class TestBasicIterativeMethod(TestFastGradientMethod):
W1 = tf.constant([[1.5, .3], [-2, 0.3]], dtype=tf.float32)
h1 = tf.nn.sigmoid(tf.matmul(x, W1))
W2 = tf.constant([[-2.4, 1.2], [0.5, -2.3]], dtype=tf.float32)
- res = tf.nn.softmax(tf.matmul(x, W2))
+ res = tf.nn.softmax(tf.matmul(h1, W2))
return res
self.sess = tf.Session()
