1a398e735d36cc8b344fa7d2bce159ee1f3ef4c2,art/attacks/boundary.py,BoundaryAttack,_attack,#BoundaryAttack#Any#Any#Any#Any#Any#,147

Before Change


                if pred == target:
                    x_adv = potential_adv
                    self.curr_epsilon /= self.step_adapt
                    break
                else:
                    self.curr_epsilon *= self.step_adapt
            else:
                logging.warning("Adversarial example found but not optimal.")

After Change


                    self.curr_delta /= self.step_adapt

                if delta_ratio > 0:
                    x_advs = np.array(potential_advs)[np.where(satisfied)[0]]
                    break
            else:
                logging.warning("Adversarial example found but not optimal.")
                return x_adv

            // Trust region method to adjust epsilon
            for _ in range(self.num_trial):
                perturb = np.repeat(np.array([original_sample]), len(x_advs), axis=0) - x_advs
                perturb *= self.curr_epsilon
                potential_advs = x_advs + perturb
                potential_advs = np.clip(potential_advs, clip_min, clip_max)
                preds = np.argmax(self.classifier.predict(potential_advs), axis=1)
                satisfied = (preds == target)
                epsilon_ratio = np.mean(satisfied)

                if epsilon_ratio < 0.2:
                    self.curr_epsilon *= self.step_adapt
                elif epsilon_ratio > 0.5:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 1a398e735d36cc8b344fa7d2bce159ee1f3ef4c2
Time: 2019-05-27
Author: M.N.Tran@ibm.com
File Name: art/attacks/boundary.py
Class Name: BoundaryAttack
Method Name: _attack


Project Name: Shmuma/ptan
Commit Name: 96df10456fb33ba1cee6b35d96c56a99eff7c8ea
Time: 2017-06-26
Author: max.lapan@gmail.com
File Name: samples/a2c.py
Class Name:
Method Name:


Project Name: drckf/paysage
Commit Name: 2f81c7d43d82c65b896d552d758c3b75fe45c558
Time: 2016-11-29
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/paysage/fit.py
Class Name:
Method Name: basic_train