-
Notifications
You must be signed in to change notification settings - Fork 36
/
args_parser.py
57 lines (44 loc) · 2.06 KB
/
args_parser.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
# coding=utf-8
import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('-pretrain_batch', '--pretrain_batch',
type=int,
help='Batch size for pretraining. Default: no batch',
default=None)
parser.add_argument('-pretrain','--pretrain',
type = bool,
default = True,
help='Pretrain model with autoencoder; otherwise load existing')
parser.add_argument('-nepoch', '--epochs',
type=int,
help='number of epochs to train for',
default=30)
parser.add_argument('-nepoch_pretrain', '--epochs_pretrain',
type=int,
help='number of epochs to pretrain for',
default=25)
parser.add_argument('-source_file','--model_file',
type = str,
default = 'trained_models/source.pt',
help='location for storing source model and data')
parser.add_argument('-lr', '--learning_rate',
type=float,
help='learning rate for the model, default=0.001',
default=0.001)
parser.add_argument('-lrS', '--lr_scheduler_step',
type=int,
help='StepLR learning rate scheduler step, default=20',
default=20)
parser.add_argument('-lrG', '--lr_scheduler_gamma',
type=float,
help='StepLR learning rate scheduler gamma, default=0.5',
default=0.5)
parser.add_argument('-seed', '--manual_seed',
type=int,
help='input for the manual seeds initializations',
default=3)
parser.add_argument('--cuda',
action='store_true',
help='enables cuda')
return parser