-
Notifications
You must be signed in to change notification settings - Fork 2
/
parameters.py
176 lines (170 loc) · 4.75 KB
/
parameters.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
#import selected_features_correlation as featcor
# FEATURES COLLAPSED
# BASELINE | SELECTED BY CORRELATION | LOW-LEVEL DESCRIPTORS
# egemaps_c = 88 | egemaps_cor1 = 58, 32, 16 | egemaps_c_LLD = 23
# compare_c = 6373 | compare_S_cor1 = 3172, 1864, 1255 | compare_c_LLD = 130
# bert_4l_c = 768 | bert_S_cor3 = 359, 169, 97 |
# bertwsp_4l_c = 768 | bertwsp_S_cor3 = 318
# openface_c = 709 | openface_S_cor1 = 129, 82, 53 |
# zeros_c = 100
# NOT COLLAPSED
# egemaps = 88 |
# egemaps_LLD = 23
# compare_LLD = 130
# bert_4l = 768
# bertwsp_4l = 768
# openface = 709
# DATASET'S PARAMETERS
def get_params_dataset(model):
params_dataset = {
'selected_features': {'bert_4l': featcor.bert4l_t3},
'task': 'emotion', # 'sentiment' | 'emotion' | 'sentiment_binary' | 'sentiment_trinary'
'tiny': False,
'balance_polarity': False,
'batch_size': 128,}
if model[-1] == 'w': params_dataset['aligned2word'] = True
else: params_dataset['aligned2word'] = False # False if features collapsed
if model[0] == 'U': params_dataset['modality'] = 'unimodal'
elif model[0] == 'B': params_dataset['modality'] = 'bimodal'
else: params_dataset['modality'] = 'multimodal'
if params_dataset['aligned2word'] == True: params_dataset['max_len'] = 30
else: params_dataset['max_len'] = 'collapsed'
return params_dataset
save = True
model_name = 'UCNN_EM_bert_t3_again_superdeep_w_all.pth'
# MODEL'S PARAMETERS
params_models = {
'MultiCNN_w': {
'emb_dims': [88, 768, 709], # acoustic, text, visual dimensions
'in_chan_a': 88,
'out_chan_a': 88*2,
'in_chan_t': 768,
'out_chan_t': 768*2,
'in_chan_v': 709,
'out_chan_v': 709*2,
'kernel': 10, # collapsed features should go with kernel = 1
'padding': 0, # collapsed features should go with padding = 0
'max_pool': 2,
'stride': 1,
'dropout': 0.7,
},
'MultiCNN_c': {
'emb_dims': [88, 768, 709], # acoustic, text, visual dimensions
'in_chan_a': 88,
'out_chan_a': 88*2,
'in_chan_t': 768,
'out_chan_t': 768*2,
'in_chan_v': 709,
'out_chan_v': 709*2,
'kernel': 10, # collapsed features should go with kernel = 1
'padding': 0, # collapsed features should go with padding = 0
'max_pool': 2,
'stride': 1,
'dropout': 0.7,
},
'UniCNN_c': {
'emb_dim': 88,
'in_chan': 88, # input channel is feature dimension
'out_chan': 88,
},
'UniCNN_w': {
'emb_dim': 97,
'in_chan': 97,
'out_chan': 97,
'conv1': {
'kernel': 5,
'padding': 2,
'stride': 1,
'dilation': 1,
},
'max_pool': 2,
'dropout': 0.3,
},
'UniCNNSemiDeep_w': {
'emb_dim': 768,
'in_chan': 768,
'out_chan': 768,
'conv1': {
'kernel': 5,
'padding': 2,
'stride': 1,
'dilation': 1,
},
'conv2': {
'kernel': 5,
'padding': 2,
'stride': 1,
'dilation': 1,
},
'max_pool': 2,
'dropout': 0.5,
},
'UniCNNDeep_w': {
'emb_dim': 16,
'in_chan': 16,
'out_chan': 16*2,
'conv1': {
'kernel': 5,
'padding': 2,
'stride': 1,
'dilation': 1,
},
'conv2': {
'kernel': 3,
'padding': 1,
'stride': 1,
'dilation': 1,
},
'conv3': {
'kernel': 1,
'padding': 0,
'stride': 1,
'dilation': 1,
},
'max_pool': 2,
'dropout': 0.3,
},
'UniCNNSuperDeep_w': {
'emb_dim': 359,
'in_chan': 359,
'out_chan': 359*2,
'conv1': {
'kernel': 5,
'padding': 2,
'stride': 1,
'dilation': 1,
},
'conv2': {
'kernel': 5,
'padding': 2,
'stride': 1,
'dilation': 1,
},
'conv3': {
'kernel': 3,
'padding': 1,
'stride': 1,
'dilation': 1,
},
'conv4': {
'kernel': 3,
'padding': 1,
'stride': 1,
'dilation': 1,
},
'conv5': {
'kernel': 1,
'padding': 0,
'stride': 1,
'dilation': 1,
},
'conv6': {
'kernel': 1,
'padding': 0,
'stride': 1,
'dilation': 1,
},
'max_pool': 2,
'dropout': 0.3,
},
}