comments from david
@@ -13,7 +13,7 @@ from cleverhans.future.tf2.attacks import projected_gradient_descent, fast_gradi
FLAGS = flags.FLAGS
class CNN(Model):
- def __init__(self, nb_filters=32):
+ def __init__(self, nb_filters=64):
super(CNN, self).__init__()
img_size = 32
log_resolution = int(round(math.log(img_size) / math.log(2)))
@@ -43,7 +43,8 @@ def ld_cifar10():
def convert_types(image, label):
image = tf.cast(image, tf.float32)
- image /= 255
+ image /= 127.5
+ image -= 1.
return image, label
dataset, info = tfds.load('cifar10',
@@ -110,7 +111,7 @@ def main(_):
if __name__ == '__main__':
- flags.DEFINE_integer('nb_epochs', 40, 'Number of epochs.')
+ flags.DEFINE_integer('nb_epochs', 200, 'Number of epochs.')
flags.DEFINE_float('eps', 0.05, 'Total epsilon for FGM and PGD attacks.')
flags.DEFINE_bool('adv_train', False, 'Use adversarial training (on PGD adversarial examples).')
app.run(main)
