-
Notifications
You must be signed in to change notification settings - Fork 366
/
quick_draw_full_x2_l6.py
89 lines (57 loc) · 1.84 KB
/
quick_draw_full_x2_l6.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
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
#!/usr/bin/python3
import os
import sys
root_folder = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root_folder)
import data_utils
sys.path.append(os.path.join(root_folder, 'data_conversions'))
import quick_draw_utils
def load_fn(folder_npz, _):
return quick_draw_utils.load_fn(folder_npz, 1.0)
balance_fn = None
def map_fn(stoke, label, point_num=512):
return quick_draw_utils.map_fn(stoke, label, point_num)
keep_remainder = True
def save_ply_fn(data_sample, folder):
data_utils.save_ply_point_with_normal(data_sample, folder)
num_parallel_calls = 16
num_class = 345
sample_num = 512
batch_size = 256
num_epochs = 32
step_val = 20000
learning_rate_base = 1e-2
decay_steps = 200000
decay_rate = 0.7
learning_rate_min = 1e-5
weight_decay = 0.0
jitter = 0.0
jitter_val = 0.0
rotation_range = [0, 0, 0, 'u']
rotation_range_val = [0, 0, 0, 'u']
order = 'rxyz'
scaling_range = [0, [0.01], 0, 'u']
scaling_range_val = [0, [0.01], 0, 'u']
sample_num_variance = 1 // 8
sample_num_clip = 1 // 4
x = 2
xconv_param_name = ('K', 'D', 'P', 'C', 'links')
xconv_params = [dict(zip(xconv_param_name, xconv_param)) for xconv_param in
[(8, 2, -1, 16 * x, []),
(12, 2, 192, 64 * x, []),
(16, 1, 64, 128 * x, []),
(16, 2, 64, 128 * x, []),
(16, 3, 64, 128 * x, []),
(16, 4, 64, num_class * x, [])]]
fc_param_name = ('C', 'dropout_rate')
fc_params = [dict(zip(fc_param_name, fc_param)) for fc_param in
[(num_class * x, 0.0),
(num_class * x, 0.5)]]
sampling = 'random'
with_global = True
optimizer = 'adam'
epsilon = 1e-6
sorting_method = None
data_dim = 6
use_extra_features = False
with_X_transformation = True