85e42ea64f4d6fdebb88e5360025de2ec4e34ea0,art/attacks/fast_gradient.py,FastGradientMethod,generate,#FastGradientMethod#Any#,111

Before Change


            x_adv = self._compute(x, y, self.eps, self.eps, self.random_init)

        adv_preds = np.argmax(self.classifier.predict(x_adv), axis=1)
        if self.targeted:
            rate = np.sum(adv_preds == np.argmax(y, axis=1)) / x_adv.shape[0]
        else:
            rate = np.sum(adv_preds != np.argmax(y, axis=1)) / x_adv.shape[0]
        logger.info("Success rate of FGM attack: %.2f%%", rate)

        return x_adv

After Change



                if rate > rate_best or adv_x_best is None:
                    rate_best = rate
                    adv_x_best = adv_x.copy()

        logger.info("Success rate of FGM attack: %.2f%%", rate_best)

        return adv_x_best
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 85e42ea64f4d6fdebb88e5360025de2ec4e34ea0
Time: 2019-04-25
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/fast_gradient.py
Class Name: FastGradientMethod
Method Name: generate


Project Name: rtqichen/torchdiffeq
Commit Name: 47ba6dedb917847460b098c5f2b776a4c8bd0c1b
Time: 2021-01-05
Author: rtqichen@gmail.com
File Name: torchdiffeq/_impl/adjoint.py
Class Name:
Method Name: odeint_adjoint


Project Name: EducationalTestingService/factor_analyzer
Commit Name: c899e6e816306956208664dcabd11e5e84e4bcb7
Time: 2019-04-02
Author: jbiggs@ets.org
File Name: factor_analyzer/factor_analyzer.py
Class Name: FactorAnalyzer
Method Name: get_factor_variance