-
Notifications
You must be signed in to change notification settings - Fork 3
/
generation_latent_guide.yaml
153 lines (140 loc) · 3.33 KB
/
generation_latent_guide.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
train_dataset:
dataset:
name: multi-ref-dvf-generation
args:
data_root: ./data/dvf_png/font_pngs/train
img_res: 128
coor_res: 256
n_samples: 0
full: true
sample_inside: false
occ: false
origin_res: true
include_lower_case: true
char_list: [0, 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]
n_refs: [2, 5]
use_cache: false
ratio: 1
valid_list: ./data/dvf_png/train_valid.txt
batch_size: 64
shuffle: true
val_dataset:
dataset:
name: multi-ref-dvf-generation
args:
data_root: ./data/dvf_png/font_pngs/test
img_res: 128
char_list: [0, 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]
val: true
use_cache: false
include_lower_case: true
ratio: 1
valid_list: ./data/dvf_png/test_valid.txt
batch_size: 16
shuffle: true
model:
name: vae-style-multi-ref-cnn
args:
sidelength: 256
train_latent: true
detach_img_branch: false
n_char: 52
encode_type: cnn
img_encoder:
name: light-img-encoder
args:
key: null
z_channels: 256
in_channels: 1
ch: 16
ch_mult: [1,2,2,4,4,8,16,16]
double_z: false
num_res_blocks: 1
attn_resolutions: [32]
dropout: 0.0
resolution: 128
tfm:
name: tfm
args:
dim: 256
depth: 4
heads: 4
dim_head: 64
mlp_dim: 256
dis_cal:
name: batched-curve-to-dis
args:
ds:
name: analytic-df
args:
n_control_points: 3
sidelength: 256
decoder:
name: z-to-curve
args:
z_dim: 256
n_points: 3
n_curves: 4
n_prims: 12
hidden_dim: 256
hidden_layers: 2
z_dim: 256
img_decoder:
name: light-img-decoder
args:
z_channels: 256
ch: 16
out_ch: 1
ch_mult: [1,1,2,2,4,4,8,8,16] # num_down = len(ch_mult)-1
num_res_blocks: 1
attn_resolutions: [64]
dropout: 0.0
resolution: 256
latent_encoder:
name: light-img-encoder
args:
key: img_origin_res
z_channels: 256
in_channels: 1
ch: 16
ch_mult: [1,2,2,4,4,8,16,16]
double_z: false
num_res_blocks: 1
attn_resolutions: [32]
dropout: 0.0
resolution: 128
submodule_config:
-
ckpt: ./save/recon/ckpt/epoch-last.pth
ckpt_key: [encoder, img_decoder, decoder, encoder]
module_name: [latent_encoder, img_decoder, decoder, img_encoder]
freeze: [true, true, true, true]
optimizer:
name: Adam
args:
lr: 1.e-4
betas: [0.9, 0.999]
scheduler:
name: CosineAnnealingWarmRestarts
args:
T_0: 32
T_mult: 2
eta_min: 1.e-5
verbose: True
loss:
name: list-loss
args:
loss_list:
-
name: latent-loss
args:
lam: 1
-
name: kl-loss
args:
lam: 0.000125
epoch_max: 64
epoch_val: 1
epoch_save: 8
run_step: false
load_optimizer: false