-
Notifications
You must be signed in to change notification settings - Fork 2
/
configs_biggan.yml
79 lines (63 loc) · 2.74 KB
/
configs_biggan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Introduction : 'Attacks with BigGAN.'
optim : 'GAN_based' #optim method, ['GAN_based', 'GAN_free']
cost_fn : 'sim_cmpr0' # the type of loss function for gradient inversion attacks.
set_seed : 123 # random seed. Following GGL, we set 123 as seed for BigGAN(ImageNet).
indices : 'def' # decide which part of gradients to be involved in the final gradients match loss.
weights : 'equal' # weight of every graident scalar's matching loss
init : 'randn' # how we initial the original latent code.
model : 'ResNet18' # FL model
restarts : 4
num_images : 1 # the number of images to reconstruct at a batch
num_exp : 10 # the number of experiments.
target_id : 0
lr : 0.03
total_variation : 0.0001 #the coefficient of total variation
bn_stat : 0 #choose if we use bn statistic to regularizer
image_norm : 0.000001 #the coefficient of norm regularizer
group_lazy : 0 #choose if we use group lazy regularization
max_iterations : 1000 #Maximum number of iterations for latent reconstruction.
#For GIAS
gias_iterations : 8000 #Maximum number of gias iterations for reconstruction.
gias_lr : 0.00001 #For biggan, we'd better choose smaller learning rate
# For input data
generative_model : 'BigGAN'
gen_dataset : 'ImageNet64'
dataset : 'IMAGENET_IO'
data_path : './dataset/media/imagenet/val' # specify your dataset path
#For output data
exp_name : 'ex1_biggan_imagenet' #Same latent space search
output_dir : 'results/'
#params for algorithm choice
gifd : true
gias : false
ggl : false
#For GIFD with biggan
steps: [1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000] #Total 13000
lr_io: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
start_layer: 0
end_layer: 13 #fixed
# For l-1 projection
project : true
do_project_gen_out: true
do_project_noises: false
do_project_latent: false
max_radius_gen_out: [1000, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500]
max_radius_noises: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] # designed for stylegan2, here unused.
max_radius_latent: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] # designed for stylegan2, here unused.
# The pre-trained StyleGAN checkpoint
ckpt: None
#LR pace for training
lr_same_pace: false
#Defense parameter
defense_method : None
defense_setting :
- noise : None
- clipping : None
- compression : None
- representation : None
#For CMA-ES in GGL
KLD : 0.1 # Recommendation: 0.1 for biggan, 0.02 for stylegan2
cma_budget : 800
num_sample : 50 # CMA-ESsample times
#cmd instruction
# python rec_mult.py --config configs_biggan.yml