ab69a2253b4229081850280c3346e7a7b1e1815c,art/wrappers/randomized_smoothing.py,RandomizedSmoothing,loss_gradient,#RandomizedSmoothing#Any#Any#,103

Before Change


        :rtype: `np.ndarray`
        
        logger.info("Applying randomized smoothing.")
        loss_gradient = []
        for idx, x_i in enumerate(x):
            x_new, y_new = self._noisy_samples(x_i, y[idx])
            loss_gradient.append(np.mean(self.classifier.loss_gradient(x_new, y_new), axis=0))
        return np.array(loss_gradient)

    def class_gradient(self, x, label=None, logits=False):
        
        Compute per-class derivatives of the given classifier w.r.t. `x`, taking an average over noisy samples.

After Change


        :rtype: `np.ndarray`
        
        logger.info("Applying randomized smoothing.")
        return self.classifier.loss_gradient(x, y)

    def class_gradient(self, x, label=None, logits=False):
        
        Compute per-class derivatives of the given classifier w.r.t. `x` of original classifier.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 13

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: ab69a2253b4229081850280c3346e7a7b1e1815c
Time: 2019-07-23
Author: 31593127+robo-sq@users.noreply.github.com
File Name: art/wrappers/randomized_smoothing.py
Class Name: RandomizedSmoothing
Method Name: loss_gradient


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: ab69a2253b4229081850280c3346e7a7b1e1815c
Time: 2019-07-23
Author: 31593127+robo-sq@users.noreply.github.com
File Name: art/wrappers/randomized_smoothing.py
Class Name: RandomizedSmoothing
Method Name: class_gradient


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c299e46022a9d6cc80e7c6aea975cc8c75627d6a
Time: 2019-08-06
Author: 31593127+robo-sq@users.noreply.github.com
File Name: art/wrappers/randomized_smoothing.py
Class Name: RandomizedSmoothing
Method Name: class_gradient


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c299e46022a9d6cc80e7c6aea975cc8c75627d6a
Time: 2019-08-06
Author: 31593127+robo-sq@users.noreply.github.com
File Name: art/wrappers/randomized_smoothing.py
Class Name: RandomizedSmoothing
Method Name: loss_gradient


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: ab69a2253b4229081850280c3346e7a7b1e1815c
Time: 2019-07-23
Author: 31593127+robo-sq@users.noreply.github.com
File Name: art/wrappers/randomized_smoothing.py
Class Name: RandomizedSmoothing
Method Name: loss_gradient