-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun_leonhard_batch.py
295 lines (278 loc) · 16.7 KB
/
run_leonhard_batch.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
from subprocess import call
import time
"""
The working directory must be the same with python file's directory.
"""
NUM_CPU = 2
MEMORY = 6000
NUM_GPU = 1
WALL_TIME = 23
# cluster_command_format = 'bsub -G ls_hilli -n {} -W {}:00 -o log_{} -R "rusage[mem={}, ngpus_excl_p={}]" '
# cluster_command_format = 'bsub -G ls_hilli -n {} -W {}:00 -o log_{} -R "rusage[mem={}, ngpus_excl_p={}]" -R "select[gpu_mtotal0>=10240]" ' # Ensures gtx1080Ti or rtx2080Ti
cluster_command_format = 'bsub -G ls_hilli -n {} -W {}:00 -o log_{} -R "rusage[mem={}, ngpus_excl_p={}]" -R "select[gpu_model0==GeForceRTX2080Ti]" ' # Ensures rtx2080Ti
experiment_list_predictive_transformer = [
# 'python ink_training_eager_embedding.py '
# '--comment "tf2-af03-t_s4-t_emb_c_freq2-dec_1e6_emb1e3" --decoder_model t_emb '
# '--latent_units 8 --grad_clip_norm 1 --batch_size 400 --affine_prob 0.3 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--resampling_factor 0 --scale_factor 0 --n_t_samples 4 --t_frequency_channels 2 '
# '--learning_rate_type transformer --stroke_loss nll_gmm '
# '--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--data_name didi_wo_text --metadata_type position ',
#
# 'python ink_training_eager_embedding.py '
# '--comment "tf2-af03-t_s4-no_gclip-t_emb_c_freq2-dec_1e6_emb1e3" --decoder_model t_emb '
# '--latent_units 8 --grad_clip_value 0 --batch_size 400 --affine_prob 0.3 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--resampling_factor 0 --scale_factor 0 --n_t_samples 4 --t_frequency_channels 2 '
# '--learning_rate_type transformer --stroke_loss nll_gmm '
# '--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--data_name didi_wo_text --metadata_type position ',
#
# 'python ink_training_eager_embedding.py '
# '--comment "tf2-af03-t_s4-no_gclip-t_emb_c_freq4" --decoder_model t_emb '
# '--latent_units 8 --grad_clip_value 0 --batch_size 400 --affine_prob 0.3 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--resampling_factor 0 --scale_factor 0 --n_t_samples 4 --t_frequency_channels 4 '
# '--learning_rate_type transformer --stroke_loss nll_gmm '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--data_name didi_wo_text --metadata_type position ',
#
# 'python ink_training_eager_embedding.py '
# '--comment "tf2-af03-t_s4-no_gclip-t_emb_c_freq4-dec_1e6_emb1e3" --decoder_model t_emb '
# '--latent_units 8 --grad_clip_value 0 --batch_size 400 --affine_prob 0.3 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--resampling_factor 0 --scale_factor 0 --n_t_samples 4 --t_frequency_channels 4 '
# '--learning_rate_type transformer --stroke_loss nll_gmm '
# '--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--data_name didi_wo_text --metadata_type position ',
##### Predictive model.
'python ink_training_eager_predictive.py '
'--comment "tf2-af03-t_s4-hyb8-emb_pos_gmm10-gnorm1-stopg-tres2" '
'--use_start_pos --pred_input_type hybrid --stop_predictive_grad '
'--stroke_loss nll_gmm --n_t_samples 4 --batch_size 128 --affine_prob 0.3 '
'--resampling_factor 2 --scale_factor 0 --grad_clip_norm 1 '
'--encoder_model transformer --transformer_scale --transformer_pos_encoding '
'--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
'--transformer_hidden_units 256 --transformer_dropout 0.0 '
'--latent_units 8 '
'--decoder_model t_emb --decoder_dropout 0.0 '
'--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
'--predictive_model transformer --learning_rate_type transformer '
'--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
'--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
'--p_transformer_scale --embedding_loss nll_gmm --embedding_gmm_components 10 '
'--loss_predicted_embedding --loss_reconstructed_ink '
'--position_model transformer '
'--data_name didi_wo_text --metadata_type position '
'--disable_pen_loss --mask_encoder_pen ',
'python ink_training_eager_predictive.py '
'--comment "tf2-af03-t_s4-hyb8-emb_pos_gmm10-gnorm1-stopg-d1e6_e1e3-tres2" '
'--use_start_pos --pred_input_type hybrid --stop_predictive_grad '
'--stroke_loss nll_gmm --n_t_samples 4 --batch_size 128 --affine_prob 0.3 '
'--resampling_factor 2 --scale_factor 0 --grad_clip_norm 1 '
'--encoder_model transformer --transformer_scale --transformer_pos_encoding '
'--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
'--transformer_hidden_units 256 --transformer_dropout 0.0 '
'--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
'--latent_units 8 '
'--decoder_model t_emb --decoder_dropout 0.0 '
'--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
'--predictive_model transformer --learning_rate_type transformer '
'--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
'--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
'--p_transformer_scale --embedding_loss nll_gmm --embedding_gmm_components 10 '
'--loss_predicted_embedding --loss_reconstructed_ink '
'--position_model transformer '
'--data_name didi_wo_text --metadata_type position '
'--disable_pen_loss --mask_encoder_pen ',
'python ink_training_eager_predictive.py '
'--comment "tf2-af03-t_s4-hyb8-emb_pos_gmm10-gnorm1-d1e6_e1e3-tres2" '
'--use_start_pos --pred_input_type hybrid '
'--stroke_loss nll_gmm --n_t_samples 4 --batch_size 128 --affine_prob 0.3 '
'--resampling_factor 2 --scale_factor 0 --grad_clip_norm 1 '
'--encoder_model transformer --transformer_scale --transformer_pos_encoding '
'--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
'--transformer_hidden_units 256 --transformer_dropout 0.0 '
'--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
'--latent_units 8 '
'--decoder_model t_emb --decoder_dropout 0.0 '
'--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
'--predictive_model transformer --learning_rate_type transformer '
'--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
'--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
'--p_transformer_scale --embedding_loss nll_gmm --embedding_gmm_components 10 '
'--loss_predicted_embedding --loss_reconstructed_ink '
'--position_model transformer '
'--data_name didi_wo_text --metadata_type position '
'--disable_pen_loss --mask_encoder_pen ',
# #### Predictive model didi_all
# 'python ink_training_eager_predictive.py '
# '--comment "tf2-af03-t_s4-hyb8-emb_pos_gmm10-gnorm1-stopg" '
# '--use_start_pos --pred_input_type hybrid --stop_predictive_grad '
# '--stroke_loss nll_gmm --n_t_samples 4 --batch_size 32 --affine_prob 0.3 '
# '--resampling_factor 0 --scale_factor 0 --grad_clip_norm 1 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--latent_units 8 '
# '--decoder_model t_emb --decoder_dropout 0.0 '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--predictive_model transformer --learning_rate_type transformer '
# '--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
# '--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
# '--p_transformer_scale --embedding_loss nll_gmm --embedding_gmm_components 10 '
# '--loss_predicted_embedding --loss_reconstructed_ink '
# '--position_model transformer '
# '--data_name didi_wo_text --metadata_type position '
# '--disable_pen_loss --mask_encoder_pen ',
#
# 'python ink_training_eager_predictive.py '
# '--comment "tf2-af03-t_s4-hyb8-emb_pos_gmm10-gnorm1-stopg-d1e6_e1e3" '
# '--use_start_pos --pred_input_type hybrid --stop_predictive_grad '
# '--stroke_loss nll_gmm --n_t_samples 4 --batch_size 64 --affine_prob 0.3 '
# '--resampling_factor 0 --scale_factor 0 --grad_clip_norm 1 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
# '--latent_units 8 '
# '--decoder_model t_emb --decoder_dropout 0.0 '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--predictive_model transformer --learning_rate_type transformer '
# '--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
# '--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
# '--p_transformer_scale --embedding_loss nll_gmm --embedding_gmm_components 10 '
# '--loss_predicted_embedding --loss_reconstructed_ink '
# '--position_model transformer '
# '--data_name didi_wo_text --metadata_type position '
# '--disable_pen_loss --mask_encoder_pen ',
#
# 'python ink_training_eager_predictive.py '
# '--comment "tf2-af03-t_s4-hyb8-emb_pos_gmm10-gnorm1-d1e6_e1e3" '
# '--use_start_pos --pred_input_type hybrid '
# '--stroke_loss nll_gmm --n_t_samples 4 --batch_size 64 --affine_prob 0.3 '
# '--resampling_factor 0 --scale_factor 0 --grad_clip_norm 1 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
# '--latent_units 8 '
# '--decoder_model t_emb --decoder_dropout 0.0 '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--predictive_model transformer --learning_rate_type transformer '
# '--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
# '--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
# '--p_transformer_scale --embedding_loss nll_gmm --embedding_gmm_components 10 '
# '--loss_predicted_embedding --loss_reconstructed_ink '
# '--position_model transformer '
# '--data_name didi_wo_text --metadata_type position '
# '--disable_pen_loss --mask_encoder_pen ',
#
# 'python ink_training_eager_predictive.py '
# '--comment "tf2-af03-t_s4-hyb8-emb_pos_gmm10-d1e6_e1e3" '
# '--use_start_pos --pred_input_type hybrid '
# '--stroke_loss nll_gmm --n_t_samples 4 --batch_size 64 --affine_prob 0.3 '
# '--resampling_factor 0 --scale_factor 0 --grad_clip_norm 0 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 '
# '--reg_emb_weight 1e-3 --reg_dec_weight 1e-6 '
# '--latent_units 8 '
# '--decoder_model t_emb --decoder_dropout 0.0 '
# '--decoder_layers 4 --decoder_hidden_units 512,512,512,512 '
# '--predictive_model transformer --learning_rate_type transformer '
# '--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
# '--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
# '--p_transformer_scale --embedding_loss nll_gmm --embedding_gmm_components 10 '
# '--loss_predicted_embedding --loss_reconstructed_ink '
# '--position_model transformer '
# '--data_name didi_wo_text --metadata_type position '
# '--disable_pen_loss --mask_encoder_pen ',
]
experiment_list_rebuttal = [
# 'python ink_training_eager_predictive.py '
# '--comment "leo_test-rebuttal-cose_no_target_pos" --gt_targets '
# '--num_pred_inputs 32 --stop_predictive_grad --pred_input_type hybrid '
# '--stroke_loss nll_gmm --n_t_samples 4 --batch_size 128 '
# '--affine_prob 0.3 --resampling_factor 2 --scale_factor 0 '
# '--grad_clip_norm 1 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 --latent_units 8 '
# '--decoder_model t_emb --decoder_dropout 0.0 --decoder_layers 4 '
# '--decoder_hidden_units 512,512,512,512 '
# '--predictive_model transformer --learning_rate_type transformer '
# '--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
# '--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
# '--p_transformer_scale '
# '--embedding_loss nll_gmm --embedding_gmm_components 10 '
# '--loss_predicted_embedding --loss_reconstructed_ink '
# '--position_model transformer --data_name didi_wo_text '
# '--metadata_type position --disable_pen_loss --mask_encoder_pen ',
# # COSE
# 'python ink_training_eager_predictive.py '
# '--comment "tf2-af03-t_s4-hyb32-tres2-gt_targ-fullstopg" --gt_targets '
# '--use_start_pos --num_pred_inputs 32 --stop_predictive_grad '
# '--pred_input_type hybrid --stroke_loss nll_gmm --n_t_samples 4 '
# '--batch_size 128 --affine_prob 0.3 --resampling_factor 2 --scale_factor 0 '
# '--grad_clip_norm 1 '
# '--encoder_model transformer --transformer_scale --transformer_pos_encoding '
# '--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
# '--transformer_hidden_units 256 --transformer_dropout 0.0 --latent_units 8 '
# '--decoder_model t_emb --decoder_dropout 0.0 --decoder_layers 4 '
# '--decoder_hidden_units 512,512,512,512 --predictive_model transformer '
# '--learning_rate_type transformer '
# '--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
# '--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
# '--p_transformer_scale --position_model transformer '
# '--embedding_loss nll_gmm --embedding_gmm_components 10 '
# '--loss_predicted_embedding --loss_reconstructed_ink '
# '--data_name didi_wo_text --metadata_type position --disable_pen_loss '
# '--mask_encoder_pen ',
'python ink_training_eager_predictive.py '
'--comment "dist_cond-af03-t_s4-hyb32-tres2-gt_targ" --gt_targets '
'--use_start_pos --num_pred_inputs 32 --stop_predictive_grad '
'--pred_input_type hybrid --stroke_loss nll_gmm --n_t_samples 4 '
'--batch_size 128 --affine_prob 0.3 --resampling_factor 2 --scale_factor 0 '
'--grad_clip_norm 1 '
'--encoder_model transformer --transformer_scale --transformer_pos_encoding '
'--transformer_layers 6 --transformer_heads 4 --transformer_dmodel 64 '
'--transformer_hidden_units 256 --transformer_dropout 0.0 --latent_units 8 '
'--decoder_model t_emb --decoder_dropout 0.0 --decoder_layers 4 '
'--decoder_hidden_units 512,512,512,512 --predictive_model transformer '
'--learning_rate_type transformer '
'--p_transformer_layers 6 --p_transformer_heads 4 --p_transformer_dmodel 64 '
'--p_transformer_hidden_units 256 --p_transformer_dropout 0.0 '
'--p_transformer_scale --position_model transformer '
'--embedding_loss nll_gmm --embedding_gmm_components 10 '
'--loss_predicted_embedding --loss_reconstructed_ink '
'--data_name didi_wo_text --metadata_type position --disable_pen_loss '
'--mask_encoder_pen ',
]
experiment_list = experiment_list_rebuttal
data = ''
experiment_timestamp = str(int(time.time()))
start_id = 1
for work_id, experiment in enumerate(experiment_list):
experiment_id = "{}.{}".format(experiment_timestamp, start_id+work_id)
time.sleep(1)
print(experiment_id)
experiment_command = experiment + data + ' --experiment_id ' + experiment_id
cluster_command = cluster_command_format.format(NUM_CPU,
WALL_TIME,
experiment_id,
MEMORY,
NUM_GPU)
call([cluster_command + experiment_command], shell=True)