-
Notifications
You must be signed in to change notification settings - Fork 0
/
train_config.py
71 lines (57 loc) · 3.01 KB
/
train_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
import argparse
def parse_args():
parser = argparse.ArgumentParser(description='command for train on CUHK-PEDES')
parser.add_argument('--name', default='Experiment01', type=str, help='output model name')
#dataset_Directory
#CUHK-PEDES
parser.add_argument('--dir', type=str,
default=r'./data',
help='directory to store dataset')
parser.add_argument('--dataset', type=str,
default="CUHKPEDES")
##save_Directory
parser.add_argument('--checkpoint_dir', type=str,
default="./log",
help='directory to store checkpoint')
parser.add_argument('--log_dir', type=str,
default="./log",
help='directory to store log')
#word_embedding
parser.add_argument('--max_length', type=int, default=64)
parser.add_argument('--embedding_type', type=str,
default='BERT')
#image setting
parser.add_argument('--width', type=int, default=128)
parser.add_argument('--height', type=int, default=384)
#CNN setting
parser.add_argument('--num_classes', type=int, default=11003)
parser.add_argument('--feature_size', type=int, default=8192)
parser.add_argument('--pretrained', action='store_false',
help='whether or not to restore the pretrained visual model')
parser.add_argument('--droprate', default=0, type=float, help='drop rate')
#experiment setting
parser.add_argument('--batch_size', type=int, default=1)
parser.add_argument('--num_epoches', type=int, default=130)
parser.add_argument('--resume', action='store_true',default='',
help='whether or not to restore the pretrained whole model') # default='./log/Experiment01/checkpoint.pth.tar',
#loss function setting
parser.add_argument('--CMPM', default=True)
parser.add_argument('--CMPC',default=True)
#Optimization setting
parser.add_argument('--optimizer', type=str, default='adam')
parser.add_argument('--wd', type=float, default=0.00004)
#adam_setting
parser.add_argument('--adam_lr', type=float, default=0.00001, help='the learning rate of adam')
parser.add_argument('--adam_alpha', type=float, default=0.9)
parser.add_argument('--adam_beta', type=float, default=0.999)
parser.add_argument('--epsilon', type=float, default=1e-8)
parser.add_argument('--lr_decay_type', type=str, default='MultiStepLR',
help='One of "MultiStepLR" or "StepLR" or "ReduceLROnPlateau"')
parser.add_argument('--lr_decay_ratio', type=float, default=0.1)
parser.add_argument('--epoches_decay', type=str, default='50_80', help='#epoches when learning rate decays')
parser.add_argument('--warm_epoch', default=10, type=int, help='the first K epoch that needs warm up')
# Default setting
parser.add_argument('--seed', type=int, default=1)
parser.add_argument('--gpus', type=str, default='0')
args = parser.parse_args()
return args