forked from phizaz/diffae
-
Notifications
You must be signed in to change notification settings - Fork 0
/
templates_cls.py
38 lines (34 loc) · 1.36 KB
/
templates_cls.py
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
from templates import *
def ffhq128_autoenc_cls():
conf = ffhq128_autoenc_130M()
conf.train_mode = TrainMode.manipulate
conf.manipulate_mode = ManipulateMode.celebahq_all
conf.manipulate_znormalize = True
conf.latent_infer_path = f'checkpoints/{ffhq128_autoenc_130M().name}/latent.pkl'
conf.batch_size = 32
conf.lr = 1e-3
conf.total_samples = 300_000
# use the pretraining trick instead of contiuning trick
conf.pretrain = PretrainConfig(
'130M',
f'checkpoints/{ffhq128_autoenc_130M().name}/last.ckpt',
)
conf.name = 'ffhq128_autoenc_cls'
return conf
def ffhq256_autoenc_cls():
'''We first train the encoder on FFHQ dataset then use it as a pretrained to train a linear classifer on CelebA dataset with attribute labels'''
conf = ffhq256_autoenc()
conf.train_mode = TrainMode.manipulate
conf.manipulate_mode = ManipulateMode.celebahq_all
conf.manipulate_znormalize = True
conf.latent_infer_path = f'checkpoints/{ffhq256_autoenc().name}/latent.pkl' # we train on Celeb dataset, not FFHQ
conf.batch_size = 32
conf.lr = 1e-3
conf.total_samples = 300_000
# use the pretraining trick instead of contiuning trick
conf.pretrain = PretrainConfig(
'130M',
f'checkpoints/{ffhq256_autoenc().name}/last.ckpt',
)
conf.name = 'ffhq256_autoenc_cls'
return conf