-
Notifications
You must be signed in to change notification settings - Fork 9
/
opts.py
96 lines (90 loc) · 2.85 KB
/
opts.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
'''
* @name: opts.py
* @description: Hyperparameter configuration. Note: For hyperparameter settings, please refer to the appendix of the paper.
'''
import argparse
def parse_opts():
parser = argparse.ArgumentParser()
arguments = {
'dataset': [
dict(name='--datasetName',
type=str,
default='mosi',
help='mosi, mosei or sims'),
dict(name='--dataPath',
default="./datasets/unaligned_50.pkl",
type=str,
help=' '),
dict(name='--seq_lens',
default=[50, 50, 50],
type=list,
help=' '),
dict(name='--num_workers',
default=8,
type=int,
help=' '),
dict(name='--train_mode',
default="regression",
type=str,
help=' '),
dict(name='--test_checkpoint',
default="./checkpoint/test/SIMS_Acc7_Best.pth",
type=str,
help=' '),
],
'network': [
dict(name='--CUDA_VISIBLE_DEVICES',
default='6',
type=str),
dict(name='--fusion_layer_depth',
default=2,
type=int)
],
'common': [
dict(name='--project_name',
default='ALMT_Demo',
type=str
),
dict(name='--is_test',
default=1,
type=int
),
dict(name='--seed', # try different seeds
default=18,
type=int
),
dict(name='--models_save_root',
default='./checkpoint',
type=str
),
dict(name='--batch_size',
default=64,
type=int,
help=' '),
dict(
name='--n_threads',
default=3,
type=int,
help='Number of threads for multi-thread loading',
),
dict(name='--lr',
type=float,
default=1e-4),
dict(name='--weight_decay',
type=float,
default=1e-4),
dict(
name='--n_epochs',
default=200,
type=int,
help='Number of total epochs to run',
)
]
}
for group in arguments.values():
for argument in group:
name = argument['name']
del argument['name']
parser.add_argument(name, **argument)
args = parser.parse_args()
return args