aed5816434e217977c3cd12f6f90c52076ea2b4a,cleverhans/utils.py,,random_targets,#Any#Any#,78
Before Change
in_cl = gt == class_ind
result[in_cl] = np.random.choice(other_classes(nb_classes, class_ind))
return tf.contrib.keras.utils.to_categorical(result, nb_classes)
def pair_visual(original, adversarial, figure=None):
After Change
result[in_cl] = np.random.choice(potential_targets, size=size)
// Encode vector of random labels as one-hot labels.
result = tf.contrib.keras.utils.to_categorical(result, nb_classes)
result = result.astype(np.int32)
return result
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: tensorflow/cleverhans
Commit Name: aed5816434e217977c3cd12f6f90c52076ea2b4a
Time: 2017-07-08
Author: papernot@google.com
File Name: cleverhans/utils.py
Class Name:
Method Name: random_targets
Project Name: albermax/innvestigate
Commit Name: c7075bd543ee95c6eb1109f47ba1dfb099cdb5e0
Time: 2018-03-02
Author: philipp.seegerer@tu-berlin.de
File Name: examples/mnist_perturbation.py
Class Name:
Method Name:
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c8a1b0aa13e6ba7b8f696681765e53d717f52c88
Time: 2019-06-26
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/adversarial_patch.py
Class Name: AdversarialPatch
Method Name: generate