f9dd2e3636db61ee1b4d32ee4f494fd9e71adc12,cleverhans/attacks.py,FastGradientMethod,generate_np,#FastGradientMethod#Any#Any#,159

Before Change


        // Verify label placeholder was defined previously if using true labels
        if params["Y"] is not None:
            error = "True labels given but label placeholder missing in _init_"
            assert self.y is not None, error

        // Define batch_eval function common to both backends
        eval_params = {"batch_size": params["batch_size"]}
        if self.back == "tf":

After Change


        import tensorflow as tf

        // Generate this attack"s graph if it hasn"t been done previously
        if not hasattr(self, "_x"):
            input_shape = list(X.shape)
            input_shape[0] = None
            self._x = tf.placeholder(tf.float32, shape=input_shape)
            self._x_adv = self.generate(self._x)

        // Run symbolic graph without or with true labels
        if params["Y"] is None:
            feed_dict = {self._x: X}
        else:
            feed_dict = {self._x: X, self.y: params["Y"]}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: tensorflow/cleverhans
Commit Name: f9dd2e3636db61ee1b4d32ee4f494fd9e71adc12
Time: 2017-03-29
Author: ngp5056@cse.psu.edu
File Name: cleverhans/attacks.py
Class Name: FastGradientMethod
Method Name: generate_np


Project Name: pyannote/pyannote-audio
Commit Name: 5af2bb18d38568aa4e12e10833b4bddff91a4765
Time: 2017-01-04
Author: bredin@limsi.fr
File Name: pyannote/audio/features/with_yaafe.py
Class Name: YaafeFeatureExtractor
Method Name: __call__


Project Name: ericmjl/pyjanitor
Commit Name: 30faff2008c7f97c474cb6cb45a66d30e6abc318
Time: 2018-11-20
Author: zach.barry@novartis.com
File Name: janitor/functions.py
Class Name:
Method Name: add_column


Project Name: dmlc/gluon-nlp
Commit Name: b92687319b42966bdd45206b4d9fd2a46fa486f6
Time: 2018-06-30
Author: szha@users.noreply.github.com
File Name: tests/unittest/test_beam_search.py
Class Name:
Method Name: test_beam_search


Project Name: markovmodel/PyEMMA
Commit Name: 9d9082eb1b1c4d2f31f9b135ad0b08ef46f53fc6
Time: 2017-04-13
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/serialization/serialization.py
Class Name: SerializableMixIn
Method Name: __getstate__