Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
Invariance-induced regularization
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fan Yang
Invariance-induced regularization
Commits
29816103
Commit
29816103
authored
Nov 12, 2019
by
wangzu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up code base
parent
2802a4f2
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1 addition
and
25 deletions
+1
-25
configs/alp_mix_wo_10.json
configs/alp_mix_wo_10.json
+0
-1
configs/alp_nat_wo_10.json
configs/alp_nat_wo_10.json
+0
-1
configs/alp_rob_wo_10.json
configs/alp_rob_wo_10.json
+0
-1
configs/at_rob_wo_10.json
configs/at_rob_wo_10.json
+0
-1
configs/kl_mix_wo_10.json
configs/kl_mix_wo_10.json
+0
-1
configs/kl_nat_wo_10.json
configs/kl_nat_wo_10.json
+0
-1
configs/kl_rob_wo_10.json
configs/kl_rob_wo_10.json
+0
-1
configs/klc_mix_wo_10.json
configs/klc_mix_wo_10.json
+0
-1
configs/klc_nat_wo_10.json
configs/klc_nat_wo_10.json
+0
-1
configs/l2_mix_wo_10.json
configs/l2_mix_wo_10.json
+0
-1
configs/l2_nat_wo_10.json
configs/l2_nat_wo_10.json
+0
-1
configs/l2_rob_wo_10.json
configs/l2_rob_wo_10.json
+0
-1
configs/std.json
configs/std.json
+0
-1
configs/std_star.json
configs/std_star.json
+0
-1
train.py
train.py
+1
-11
No files found.
configs/alp_mix_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/alp_nat_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
true
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/alp_rob_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
true
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/at_rob_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
true
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/kl_mix_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
8
},
...
...
configs/kl_nat_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
true
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
8
},
...
...
configs/kl_rob_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
true
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
8
},
...
...
configs/klc_mix_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
8
},
...
...
configs/klc_nat_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
true
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
8
},
...
...
configs/l2_mix_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/l2_nat_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
true
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/l2_rob_wo_10.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
true
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/std.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
configs/std_star.json
View file @
29816103
...
...
@@ -30,7 +30,6 @@
"adversarial_ce"
:
false
,
"nat_ce"
:
false
,
"data_augmentation"
:
true
,
"data_augmentation_reg"
:
false
,
"group_size"
:
2
,
"lambda_"
:
1
},
...
...
train.py
View file @
29816103
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment