Commit 29816103 authored by wangzu's avatar wangzu

clean up code base

parent 2802a4f2
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": true,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": true,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": true,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 8
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": true,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 8
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": true,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 8
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 8
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": true,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 8
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": true,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": true,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -30,7 +30,6 @@
"adversarial_ce": false,
"nat_ce": false,
"data_augmentation": true,
"data_augmentation_reg": false,
"group_size": 2,
"lambda_": 1
},
......
......@@ -273,11 +273,6 @@ def train(config='configs/std.json',
tf.summary.scalar('learning_rate', learning_rate, collections=['nat'])
nat_summaries = tf.summary.merge_all('nat')
# data augmentation used if config.training.data_augmentation_reg is True
x_input_placeholder = tf.placeholder(tf.float32, shape=[None, 32, 32, 3])
flipped = tf.map_fn(lambda img: tf.image.random_flip_left_right(img),
x_input_placeholder)
with tf.Session() as sess:
# initialize standard data augmentation
if config.training.data_augmentation:
......@@ -338,12 +333,7 @@ def train(config='configs/std.json',
id_batch_adv = np.arange(0, num_grouped_ids, 1, dtype="int32")
for _ in range(config.training.group_size-1):
if config.training.data_augmentation_reg:
x_batch_reg = sess.run(flipped,
feed_dict={x_input_placeholder:
x_batch[0:num_grouped_ids, :, :, :]})
else:
x_batch_reg = x_batch[0:num_grouped_ids, :, :, :]
x_batch_reg = x_batch[0:num_grouped_ids, :, :, :]
# create rotated examples w.r.t regularizer
x_batch_adv, trans_adv = attack.perturb(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment