-
Notifications
You must be signed in to change notification settings - Fork 110
/
ae_templates.py
executable file
·56 lines (42 loc) · 1.46 KB
/
ae_templates.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'''
Created on September 2, 2017
@author: optas
'''
import numpy as np
from . encoders_decoders import encoder_with_convs_and_symmetry, decoder_with_fc_only
def mlp_architecture_ala_iclr_18(n_pc_points, bneck_size, bneck_post_mlp=False):
''' Single class experiments.
'''
if n_pc_points != 2048:
raise ValueError()
encoder = encoder_with_convs_and_symmetry
decoder = decoder_with_fc_only
n_input = [n_pc_points, 3]
encoder_args = {'n_filters': [64, 128, 128, 256, bneck_size],
'filter_sizes': [1],
'strides': [1],
'b_norm': True,
'verbose': True
}
decoder_args = {'layer_sizes': [256, 256, np.prod(n_input)],
'b_norm': False,
'b_norm_finish': False,
'verbose': True
}
if bneck_post_mlp:
encoder_args['n_filters'].pop()
decoder_args['layer_sizes'][0] = bneck_size
return encoder, decoder, encoder_args, decoder_args
def default_train_params(single_class=True):
params = {'batch_size': 50,
'training_epochs': 500,
'denoising': False,
'learning_rate': 0.0005,
'z_rotate': False,
'saver_step': 10,
'loss_display_step': 1
}
if not single_class:
params['z_rotate'] = True
params['training_epochs'] = 1000
return params