Пример #1
0
 def test_stronger_pgd_targeted_attack_with_sgd_optimizer(self):
     unrolled_optimizer = UnrolledGradientDescent(lr=1000.)
     self.helper_pgd_attack(unrolled_optimizer=unrolled_optimizer,
                            targeted=True,
                            epsilon=5.,
                            nb_iters=100,
                            clip_min=-10.,
                            clip_max=10.,
                            assert_threshold=0.9)
Пример #2
0
 def test_pgd_untargeted_attack_with_sgd_optimizer(self):
     unrolled_optimizer = UnrolledGradientDescent(lr=1000.)
     self.helper_pgd_attack(unrolled_optimizer=unrolled_optimizer,
                            targeted=False,
                            epsilon=.5,
                            nb_iters=20,
                            clip_min=-10.,
                            clip_max=10.,
                            assert_threshold=0.6)