32f016f01de1222e1e9bc4e40bfa92db15ddf66d,cleverhans/utils_tf.py,,clip_eta,#Any#Any#Any#,385

Before Change


        elif ord == 2:
            // avoid_zero_div must go inside sqrt to avoid a divide by zero
            // in the gradient through this operation
            norm = tf.sqrt(tf.maximum(avoid_zero_div,
                                      tf.reduce_sum(tf.square(eta),
                                                    reduc_ind,
                                                    keep_dims=True)))
        // We must *clip* to within the norm ball, not *normalize* onto the
        // surface of the ball
        factor = tf.minimum(1., eps / norm)
        eta = eta * factor

After Change


            // avoid_zero_div must go inside sqrt to avoid a divide by zero
            // in the gradient through this operation
            if LooseVersion(tf.__version__) < LooseVersion("1.8.0"):
                eta_sum = tf.reduce_sum(tf.square(eta),
                                        reduc_ind, keep_dims=True)
            else:
                eta_sum = tf.reduce_sum(tf.square(eta),
                                        reduc_ind, keepdims=True)
            norm = tf.sqrt(tf.maximum(avoid_zero_div,eta_sum))

        // We must *clip* to within the norm ball, not *normalize* onto the
        // surface of the ball
        factor = tf.minimum(1., eps / norm)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: tensorflow/cleverhans
Commit Name: 32f016f01de1222e1e9bc4e40bfa92db15ddf66d
Time: 2018-07-04
Author: krishnaphaniiitg@gmail.com
File Name: cleverhans/utils_tf.py
Class Name:
Method Name: clip_eta


Project Name: tensorflow/cleverhans
Commit Name: 05425c36bd27b0611f0ea202aaf9d3c3934bda59
Time: 2017-12-23
Author: dongyinpeng@gmail.com
File Name: cleverhans/attacks.py
Class Name: MomentumIterativeMethod
Method Name: generate


Project Name: tensorflow/cleverhans
Commit Name: 985c0de1dc22c69bdad163a8cd3a3ec4128657b2
Time: 2018-07-10
Author: krishnaphaniiitg@gmail.com
File Name: cleverhans/utils_tf.py
Class Name:
Method Name: clip_eta