fd212daee366a65eb733c0e55f91e7358ef9f715,unrestricted_advex/mnist_baselines/spatial_attack.py,,,#,32

Before Change



images = tf.placeholder(tf.float32, (None, 28, 28, 1))
angle = tf.placeholder(tf.float32, [])
shift_xy = tf.placeholder(tf.float32, [None, 2])

padded = tf.pad(images, [(0, 0), (2, 2), (2, 2), (0, 0)])
rotated = tf.contrib.image.rotate(padded, angle, "BILINEAR")
shifted = tf.contrib.image.translate(padded, shift_xy, "BILINEAR")

def did_extrude(image):
  image = np.copy(image)
  image[:,2:30,2:30] = 0

After Change


    print("".join([remap[int(round(x))] for x in img[i*28:i*28+28]]))


with tf.Session() as sess:
  mnist_model = mnist_model.Model("models/adversarial_bs=256/", sess)
  tcu_model = tcu_model.TCUWrapper(mnist_model)

  def iterator():
    which = (mnist.test.labels==7)|(mnist.test.labels==6)
    for i in range(1):
      yield mnist.test.images[which][i:i+100].reshape((100,28,28,1)), mnist.test.labels[which][i:i+100]==7
    

  logits = tcu_model(x_input)
  def np_tcu_model(x):
    return sess.run(logits, {x_input: x})
      
  eval_with_attacks.evaluate_mnist_tcu_model(np_tcu_model,
                                             iterator())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: google/unrestricted-adversarial-examples
Commit Name: fd212daee366a65eb733c0e55f91e7358ef9f715
Time: 2018-08-22
Author: nicholas@carlini.com
File Name: unrestricted_advex/mnist_baselines/spatial_attack.py
Class Name:
Method Name:


Project Name: google/unrestricted-adversarial-examples
Commit Name: fd212daee366a65eb733c0e55f91e7358ef9f715
Time: 2018-08-22
Author: nicholas@carlini.com
File Name: unrestricted_advex/mnist_baselines/spatial_attack.py
Class Name:
Method Name:


Project Name: CyberReboot/NetworkML
Commit Name: e2226f604c7f6444630be324d06a8130a01f3366
Time: 2018-01-22
Author: CStephenson970@gmail.com
File Name: NodeClassifier/utils/rnnclassifier.py
Class Name: AbnormalDetector
Method Name: __init__


Project Name: zsdonghao/text-to-image
Commit Name: 74796ff02e9425ca336f595978fe6e7c422c0378
Time: 2017-04-11
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name: DropoutLayer
Method Name: __init__