-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.json
More file actions
562 lines (562 loc) · 25.8 KB
/
Copy pathschema.json
File metadata and controls
562 lines (562 loc) · 25.8 KB
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/root.json",
"type": "object",
"title": "Polyglot",
"required": [
"experiments"
],
"properties": {
"experiments": {
"$id": "#/properties/experiments",
"type": "array",
"title": "Experiments to run by order",
"description": "Each experiment defines it's models and their hyperparameters",
"default": null,
"minItems": 1,
"items": {
"$id": "#/properties/experiments/items",
"type": "object",
"title": "Required params for defining an experiment",
"required": [
"name",
"models",
"learning_technique",
"hyperparameters"
],
"properties": {
"name": {
"$id": "#/properties/experiments/items/properties/name",
"type": "string",
"title": "UNIQUE name of experiment",
"description": "MUST BE UNIQUE",
"default": "",
"examples": [
"exp_1"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"models": {
"$id": "#/properties/experiments/items/properties/models",
"type": "array",
"title": "Models to run",
"description": "each name must match the name of folder under rnnlm/models and the key in the hyperparameters hash",
"default": null,
"minItems": 1,
"uniqueItems": true,
"additionalItems": false,
"items": {
"$id": "#/properties/experiments/items/properties/models/items",
"type": "string",
"title": "name of the model to run from rnnlm/models",
"default": "",
"minLength": 1,
"examples": [
"lstm_fast"
],
"pattern": "^(.*)$"
}
},
"predict_mode": {
"$id": "#/properties/experiments/items/properties/predict_mode",
"type": "boolean",
"title": "Prediction mode",
"description": "whether to use the model to predict (true) or train (false)",
"default": false,
"examples": [
false
]
},
"learning_technique": {
"$id": "#/properties/experiments/items/properties/learning_technique",
"type": "string",
"title": "Learning technique",
"description": "what learning technique to use to train the model",
"default": "normal",
"enum": [
"normal",
"transfer",
"multitask"
],
"examples": [
"normal",
"transfer",
"multitask"
],
"pattern": "^(.*)$"
},
"hyperparameters": {
"$id": "#/properties/experiments/items/properties/hyperparameters",
"type": "object",
"title": "Hyperparameters Schema",
"description": "Hyperparameters per model. Each key must match the model name in 'models' array and the folder under rnnlm/models",
"default": null,
"required": [
"shared_params"
],
"properties": {
"shared_params": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params",
"type": "object",
"title": "Hyperparameters for the shared layer. Shared layer is usually the hidden layers that are share between all tasks",
"description": "hyperparameters for the shared layer between tasks, if training one task, here you define the parameters for the hidden layer etc.",
"default": null,
"required": [
"create_model",
"data",
"train",
"arch"
],
"properties": {
"create_model": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/create_model",
"type": "string",
"title": "Name of the model that creates the shared layers",
"description": "The name of the model that will be used to create the hidden layers that are shared between all tasks.",
"default": "",
"examples": [
"lstm_fast"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"data": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/data",
"type": "object",
"title": "Paths and configurations for the data files",
"description": "Paths and configurations for the data files",
"default": null,
"required": [
"save_path"
],
"properties": {
"save_path": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/data/properties/save_path",
"type": "string",
"title": "Path where the results will be saved",
"description": "Path where the results will be saved",
"default": "",
"examples": [
"results"
],
"minLength": 1,
"pattern": "^(.*)$"
}
}
},
"train": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train",
"type": "object",
"title": "Training hyperparams that are shared between all tasks",
"description": "shared training parameters",
"default": null,
"required": [
"summary_steps",
"save_checkpoint_steps",
"keep_checkpoint_max",
"early_stopping"
],
"properties": {
"summary_steps": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/summary_steps",
"type": "integer",
"title": "Steps interval for saving TensorBoard summarizes",
"description": "Steps interval for saving TensorBoard summarizes",
"default": 100,
"examples": [
100
],
"minimum": 0
},
"save_checkpoint_steps": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/save_checkpoint_steps",
"type": "integer",
"title": "Steps interval for saving checkpoints",
"description": "Steps interval for saving checkpoints. A step is batch of data.",
"default": 200,
"examples": [
200
],
"minimum": 10
},
"keep_checkpoint_max": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/keep_checkpoint_max",
"type": "integer",
"title": "The Keep_checkpoint_max Schema",
"description": "how many files to keep for checkpoint history",
"default": 5,
"examples": [
5
],
"minimum": 1,
"maximum": 10
},
"multitask": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/multitask",
"type": "object",
"title": "Parameters for multitask learning",
"description": "Parameters for multitask learning - valid if training with learning_technique = multitask",
"default": null,
"required": [
"num_multitask_epochs",
"switch_each_epoch",
"switch_each_batch"
],
"properties": {
"num_multitask_epochs": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/multitask/properties/num_multitask_epochs",
"type": "integer",
"title": "Number of multitask epochs",
"description": "Multitask epoch are the num of epochs, this can be also referred as num of dataset context switches",
"default": 0,
"examples": [
20
],
"minimum": 0
},
"switch_each_epoch": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/multitask/properties/switch_each_epoch",
"type": "boolean",
"title": "Whether to change task after each epoch",
"default": false,
"examples": [
true
]
},
"switch_each_batch": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/multitask/properties/switch_each_batch",
"type": "boolean",
"title": "Whether to change task after each batch",
"default": false,
"examples": [
true
]
}
}
},
"early_stopping": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/early_stopping",
"type": "object",
"title": "Early stopping configuration",
"description": "Early stopping configuration",
"required": [
"threshold",
"max_steps_without_improvement"
],
"properties": {
"threshold": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/early_stopping/properties/threshold",
"type": "number",
"title": "The Threshold of decision for identifying a training epoch without improvement",
"description": "This parameters is checked with the loss after each batch. Each time there is no improvement of at least this threshold, the estimator increments a count of steps without improvement.",
"default": 0.0,
"examples": [
0.001
],
"minimum": 0.0
},
"max_steps_without_improvement": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/early_stopping/properties/max_steps_without_improvement",
"type": "integer",
"title": "How many steps should the system count of no improvement in training with the threshold, before stopping the training.",
"default": 0,
"examples": [
10000
],
"minimum": 1
}
}
},
"start_from_experiment": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/train/properties/start_from_experiment",
"type": "string",
"title": "Directory of checkpoint to start from",
"description": "Directory of checkpoint to start from, tensors from here will be loaded and the experiment will used pre trained tensors",
"default": ""
}
}
},
"arch": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/shared_params/properties/arch",
"type": "object",
"title": "Parameters for building the architecture of the model. Should by used in model.py of each model.",
"description": "Architecture parameters for the model",
"default": null,
"required": [
],
"properties": {}
}
}
}
},
"additionalProperties": {
"type": "object",
"title": "Hyperparameters for model schema",
"required": [
"data",
"train"
],
"properties": {
"data": {
"type": "object",
"title": "params for the data files",
"description": "Contains params for the data files",
"required": [
"pre_train",
"data_path",
"train_raw_data_file",
"valid_raw_data_file",
"test_raw_data_file",
"vocab_path_features",
"vocab_path_labels",
"vocab_size_features",
"vocab_size_labels",
"shape_size_features",
"shape_size_labels",
"tf_record_train_file",
"tf_record_valid_file",
"tf_record_test_file"
],
"properties": {
"pre_train": {
"type": "boolean",
"title": "Whether to call pre_train.py of not",
"description": "Whether to perform actions before training. If true, the models/model_name/pre_training.py will ran. You can do in pre_training some pre-process and the conversion of the data to tf record format",
"default": false,
"examples": [
false
]
},
"data_path": {
"type": "string",
"title": "The path to the data folder, must be relative to the project's root folder",
"description": "The path to the data folder, must be relative to the project's root folder",
"default": "rnnlm/data",
"examples": [
"rnnlm/data"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"train_raw_data_file": {
"type": "string",
"title": "The file containing training data that has not been pre processed",
"description": "The file containing training data that has not been pre processed",
"default": "",
"examples": [
"train"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"valid_raw_data_file": {
"type": "string",
"title": "The file containing validation data that has not been pre processed",
"default": "",
"description": "The file containing validation data that has not been pre processed",
"examples": [
"valid"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"test_raw_data_file": {
"type": "string",
"title": "The file containing test data that has not been pre processed",
"description": "The file containing test data that has not been pre processed",
"default": "",
"minLength": 1,
"examples": [
"test"
],
"pattern": "^(.*)$"
},
"vocab_path_features": {
"type": "string",
"title": "Vocab_path for the features, relative to data_path.",
"description": "File path relative to data_path. Vocabulary of words that appear as features in the data.",
"default": "",
"examples": [
"wordlist.rnn.final"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"vocab_path_labels": {
"type": "string",
"title": "Vocab_path for the labels, relative to data_path.",
"description": "File path relative to data_path. Vocabulary of words that appear as labels in the data.",
"default": "",
"minLength": 1,
"examples": [
"wordlist.rnn.final"
],
"pattern": "^(.*)$"
},
"vocab_size_features": {
"type": "integer",
"title": "Size of the features vocabulary",
"description": "Size of the features vocabulary",
"default": 0,
"minimum": 1,
"examples": [
10000
]
},
"vocab_size_labels": {
"type": "integer",
"title": "Size of the labels vocabulary",
"description": "Size of the labels vocabulary",
"default": 0,
"minimum": 1,
"examples": [
37
]
},
"shape_size_features" : {
"type": "integer",
"title": "Shape size of the features",
"description": "Shape size of the features",
"default": 0,
"minimum": 1,
"examples": [
20
]
},
"shape_size_labels" : {
"type": "integer",
"title": "Shape size of the features",
"description": "Shape size of the features",
"default": 0,
"minimum": 1,
"examples": [
1
]
},
"tf_record_train_file": {
"type": "string",
"title": "File name of the training tf record file. If pre_train is true this file will be created. Relative to data_path.",
"description": "File name of the training tf record file. If pre_train is true this file will be created. Relative to data_path.",
"default": "",
"examples": [
"train.tfrecord"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"tf_record_valid_file": {
"type": "string",
"title": "File name of the validation tf record file. If pre_train is true this file will be created. Relative to data_path",
"default": "",
"description": "File name of the validation tf record file. If pre_train is true this file will be created. Relative to data_path.",
"examples": [
"valid.tfrecord"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"tf_record_test_file": {
"type": "string",
"title": "File name of the test tf record file. If pre_train is true this file will be created. Relative to data_path",
"default": "",
"description": "File name of the test tf record file. If pre_train is true this file will be created. Relative to data_path.",
"examples": [
"test.tfrecord"
],
"minLength": 1,
"pattern": "^(.*)$"
},
"shuffle": {
"type": "boolean",
"title": "Whether to shuffle the data while training or not",
"description": "Whether to shuffle the data while training or not. Will shuffles batches of data",
"default": false,
"examples": [
false
]
},
"shuffle_buffer_size": {
"type": "integer",
"title": "How many batches to shuffle from",
"description": "How many batches to shuffle from",
"default": 10000,
"minimum": 0,
"examples": [
10000
]
}
}
},
"train": {
"type": "object",
"title": "Hyperparameters for training the model",
"description": "Contains hyperparameters for training the model",
"required": [
"batch_size",
"num_epochs",
"epoch_size_train",
"epoch_size_valid",
"epoch_size_test"
],
"properties": {
"batch_size": {
"type": "integer",
"title": "Batch_size",
"description": "Batch size",
"default": 64,
"minimum": 1,
"examples": [
64
]
},
"num_epochs": {
"type": "integer",
"title": "Num_epochs",
"description": "Number of training epochs",
"default": 20,
"minimum": 1,
"examples": [
20
]
},
"epoch_size_train": {
"type": "integer",
"title": "Number of words in a training epoch",
"description": "Number of words in a training epoch",
"default": 0,
"examples": [
1292
]
},
"epoch_size_valid": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/lstm_fast/properties/train/properties/epoch_size_valid",
"type": "integer",
"title": "Number of words in a validation epoch",
"description": "Number of words in a validation epoch",
"default": 0,
"examples": [
130
]
},
"epoch_size_test": {
"$id": "#/properties/experiments/items/properties/hyperparameters/properties/lstm_fast/properties/train/properties/epoch_size_test",
"type": "integer",
"title": "Number of words in a test epoch",
"description": "Number of words in a test epoch",
"default": 0,
"examples": [
156
]
}
}
}
}
}
}
}
}
}
}
}