-
Notifications
You must be signed in to change notification settings - Fork 2
/
configs_stylegan2.yml
81 lines (63 loc) · 2.47 KB
/
configs_stylegan2.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
80
81
Introduction : 'Attacks with StyleGAN2.'
optim : 'GAN_based' #optim method, ['GAN_based', 'GAN_free']
cost_fn : 'sim_cmpr0' #the type of loss function
set_seed : 0 # random seed. Following GIAS, we set 0 as seed for StyleGAN2(FFHQ).
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.001
# For input data
generative_model : 'stylegan2_io'
gen_dataset : 'FFHQ64'
dataset : 'FFHQ64'
data_path : './dataset/FFHQ-128' # specify your dataset path
#For output data
exp_name : 'ex1_stylegan2_ffhq' #Same latent space search
output_dir : 'results/'
#params for algorithm choice
gifd : true
gias : false
ggl : false
#For GIFD with stylegan2
steps : [1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000] #8000 in total
lr_io: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
start_layer: 0
end_layer: 8 #fixed
# For l-1 projection
project : true
do_project_gen_out: true
do_project_noises: true
do_project_latent: true
max_radius_gen_out: [1000, 2000, 3000, 4000, 5000, 6000, 8000, 8000]
max_radius_noises: [1000, 2000, 3000, 4000, 5000, 6000, 8000, 8000]
max_radius_latent: [1000, 2000, 3000, 4000, 5000, 6000, 8000, 8000]
# The pre-trained StyleGAN checkpoint
ckpt: './inversefed/genmodels/stylegan2_io/stylegan2-ffhq-config-f.pt'
#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
KLD : 0
cma_budget : 800
num_sample : 50 #sample times
#cmd instruction
# python rec_mult.py --config configs_stylegan2.yml