From 5f9da807674ad597feff0b4e586298f1728ac9f9 Mon Sep 17 00:00:00 2001 From: Nicholas Carlini Date: Tue, 20 Nov 2018 21:39:29 +0000 Subject: [PATCH] Add model build to constructor of BIM/Madry --- tests_tf/test_attacks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests_tf/test_attacks.py b/tests_tf/test_attacks.py index a937030fa..7f8dd40c8 100644 --- a/tests_tf/test_attacks.py +++ b/tests_tf/test_attacks.py @@ -959,8 +959,6 @@ class TestMomentumIterativeMethod(TestProjectedGradientDescent): def setUp(self): super(TestMomentumIterativeMethod, self).setUp() - self.sess = tf.Session() - self.model = SimpleModel() self.attack = MomentumIterativeMethod(self.model, sess=self.sess) def test_generate_np_can_be_called_with_different_decay_factor(self): @@ -983,6 +981,8 @@ def test_multiple_initial_random_step(self): class TestMadryEtAl(CleverHansTest): def setUp(self): super(TestMadryEtAl, self).setUp() + self.model = DummyModel('madryetal_dummy_model') + self.sess = tf.Session() def test_attack_can_be_constructed(self): ok = True @@ -996,6 +996,8 @@ def test_attack_can_be_constructed(self): class TestBasicIterativeMethod(CleverHansTest): def setUp(self): super(TestBasicIterativeMethod, self).setUp() + self.model = DummyModel('bim_dummy_model') + self.sess = tf.Session() def test_attack_can_be_constructed(self): ok = True