forked from AljazBozic/NeuralGraph
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
160 lines (140 loc) · 6.47 KB
/
config.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
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
154
155
156
157
158
159
160
import os
#####################################################################################################################
# DATA OPTIONS
#####################################################################################################################
data_root_dir = "./out/dataset"
experiments_dir = "./out/experiments"
#####################################################################################################################
# DATA LOADING OPTIONS
#####################################################################################################################
num_worker_threads = 0 # 0 means that the base thread does all the job (that makes sense when hdf5 is already loaded into memory).
num_threads = 4
num_samples_eval = 100
cache_data = True
#####################################################################################################################
# MODEL INFO
#####################################################################################################################
# Pretrained model
initialize_from_other = False
saved_model_path = ""
saved_model_iteration = 0
# Freeze model
freeze_node_encoder = False
freeze_scale_estimator = False
freeze_position_estimator = False
freeze_rotation_estimator = False
freeze_affinity = False
freeze_surface_mlp = False
#####################################################################################################################
# GENERAL OPTIONS
#####################################################################################################################
# Do evaluation
do_evaluation = True
# Shuffle batch
shuffle = True
# Detect anomalies, such as when gradients explode
detect_anomaly = False
#####################################################################################################################
# NODE OPTIONS
#####################################################################################################################
num_nodes = 100
position_length = 3 + 1
scale_length = 3
rotation_length = 3
graph_num_point_samples = 3000
shape_num_point_samples = 1500
interior_point_weight = 10.0
soft_transfer_scale = 100.0
level_set = -0.07
num_neighbors = 2
use_constants = True
scaling_type = "isotropic" # ["isotropic", "anisotropic", "none"]
aggregate_coverage_with_max = False
#####################################################################################################################
# MULTI-SDF OPTIONS
#####################################################################################################################
# SDF settings
truncation = 0.1
# Model settings
num_features = 32
use_tanh = True
# Descriptors
descriptor_dim = 32
#####################################################################################################################
# TRAINING OPTIONS
#####################################################################################################################
graph_batch_size = 16
shape_batch_size = 4
evaluation_frequency = 5000
epochs = 1000000
graph_learning_rate = 5e-5
shape_learning_rate = 5e-4
weight_decay = 0
interval_step = 50000
# Losses
lambda_geometry = 1.0
lambda_sampling_uniform = 1.0
lambda_sampling_near_surface = 0.1
lambda_sampling_node_center = 1.0
lambda_viewpoint_position = 10.0
lambda_viewpoint_scale = 1.0
lambda_viewpoint_constant = 1.0
lambda_viewpoint_rotation = 1e-4
lambda_surface_consistency = 1e-6
lambda_surface_consistency_f = 10.0
lambda_surface_consistency_max = 1000.0
lambda_affinity_rel_dist = 0.1
lambda_affinity_rel_dist_f = 10.0
lambda_affinity_rel_dist_max = 10000.0
lambda_affinity_abs_dist = 0.1
lambda_affinity_abs_dist_f = 10.0
lambda_affinity_abs_dist_max = 1.0
lambda_unique_neighbor = 1e-8
lambda_unique_neighbor_f = 10.0
lambda_unique_neighbor_max = 1e-3
#####################################################################################################################
# PRINT HYPERPARAMS
#####################################################################################################################
def print_hyperparams(data, experiment_name):
print()
print("HYPERPARAMETERS:")
print()
print("\tDATA: ", data)
print("\tEXPERIMENT: ", experiment_name)
print()
print("\tnum_worker_threads ", num_worker_threads)
print("\tnum_threads ", num_threads)
print()
print("################# NODE OPTIONS #######################")
print("\tgraph_num_point_samples ", graph_num_point_samples)
print("\tshape_num_point_samples ", shape_num_point_samples)
print("\tuse_constants ", use_constants)
print("\tscaling_type ", scaling_type)
print()
print("############### TRAINING OPTIONS #####################")
print("\tgraph_batch_size ", graph_batch_size)
print("\tshape_batch_size ", shape_batch_size)
print("\tevaluation_frequency ", evaluation_frequency)
print("\tgraph_learning_rate ", graph_learning_rate)
print("\tshape_learning_rate ", shape_learning_rate)
print()
print("\tlambda_geometry ", lambda_geometry)
print("\tlambda_sampling_uniform ", lambda_sampling_uniform)
print("\tlambda_sampling_near_surface ", lambda_sampling_near_surface)
print("\tlambda_sampling_node_center ", lambda_sampling_node_center)
print("\tlambda_viewpoint_position ", lambda_viewpoint_position)
print("\tlambda_viewpoint_scale ", lambda_viewpoint_scale)
print("\tlambda_viewpoint_constant ", lambda_viewpoint_constant)
print("\tlambda_viewpoint_rotation ", lambda_viewpoint_rotation)
print("\tlambda_surface_cons ", lambda_surface_consistency)
print("\tlambda_surface_cons_f ", lambda_surface_consistency_f)
print("\tlambda_surface_cons_max ", lambda_surface_consistency_max)
print("\tlambda_affinity_rel_dist ", lambda_affinity_rel_dist)
print("\tlambda_affinity_rel_dist_f ", lambda_affinity_rel_dist_f)
print("\tlambda_affinity_rel_dist_max ", lambda_affinity_rel_dist_max)
print("\tlambda_affinity_abs_dist ", lambda_affinity_abs_dist)
print("\tlambda_affinity_abs_dist_f ", lambda_affinity_abs_dist_f)
print("\tlambda_affinity_abs_dist_max ", lambda_affinity_abs_dist_max)
print("\tlambda_unique_neighbor ", lambda_unique_neighbor)
print("\tlambda_unique_neighbor_f ", lambda_unique_neighbor_f)
print("\tlambda_unique_neighbor_max ", lambda_unique_neighbor_max)