-
Notifications
You must be signed in to change notification settings - Fork 8
/
best_metrics.py
110 lines (95 loc) · 3.05 KB
/
best_metrics.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
class Best():
best_epoch = -1
best_test_epoch = -1
best_val_epoch = -1
best_val_epoch_lr = -1
best_test_epoch_lr = -1
test_mae_at_valid_best = -1
test_cor_at_valid_best = -1
test_acc_at_valid_best = -1
test_ex_zero_acc_at_valid_best = -1
test_acc_7_at_valid_best = -1
test_f1_raven_at_valid_best = -1
test_f1_mfn_at_valid_best = -1
test_f1_mult_at_valid_best = -1
valid_mae_at_test_best = -1
valid_cor_at_test_best = -1
valid_acc_at_test_best = -1
valid_ex_zero_acc_at_test_best = -1
valid_acc_7_at_test_best = -1
valid_f1_raven_at_test_best = -1
valid_f1_mfn_at_test_best = -1
valid_f1_mult_at_test_best = -1
checkpoints_val_mae = {}
checkpoints_test_mae = {}
checkpoints_val_ex_0_acc = {}
checkpoints_test_ex_0_acc = {}
max_train_f1 = -1
max_test_f1 = -1
max_valid_f1 = -1
max_valid_f1_mfn = -1
max_valid_f1_raven = -1
max_valid_f1_mult = -1
max_test_f1_mfn = -1
max_test_f1_raven = -1
max_test_f1_mult = -1
max_test_prec = -1
max_valid_prec = -1
max_train_prec = -1
max_train_recall = -1
max_test_recall = -1
max_valid_recall = -1
max_train_acc = -1
max_valid_acc = -1
max_test_acc = -1
max_valid_ex_zero_acc = -1
max_test_ex_zero_acc = -1
max_valid_acc_5 = -1
max_test_acc_5 = -1
max_valid_acc_7 = -1
max_test_acc_7 = -1
test_cor_at_valid_max = -1
test_acc_at_valid_max = -1
test_ex_zero_acc_at_valid_max = -1
test_acc_5_at_valid_max = -1
test_acc_7_at_valid_max = -1
test_f1_at_valid_max = -1
test_f1_mfn_at_valid_max = -1
test_f1_raven_at_valid_max = -1
test_f1_mult_at_valid_max = -1
test_prec_at_valid_max = -1
test_recall_at_valid_max = -1
min_train_mae = 9999
min_test_mae = 9999
max_test_cor = -1
min_valid_mae = 9999
max_valid_cor = -1
test_mae_at_valid_min = 9999
test_cor_at_valid_max = -1
iemocap_emos = ["Neutral", "Happy", "Sad", "Angry"]
split = ['train', 'valid', 'test_at_valid_max', 'test']
max_iemocap_f1 = {}
max_iemocap_acc = {}
best_iemocap_epoch = {}
for sp in split:
max_iemocap_f1[sp] = {}
max_iemocap_acc[sp] = {}
best_iemocap_epoch[sp] = {}
for em in iemocap_emos:
max_iemocap_f1[sp][em] = -1
max_iemocap_acc[sp][em] = -1
best_iemocap_epoch[sp][em] = -1
pom_cls = ["Confidence", "Passionate", "Voice pleasant", "Dominant", "Credible", "Vivid", "Expertise",
"Entertaining", "Reserved", "Trusting", "Relaxed", "Outgoing", "Thorough",
"Nervous", "Sentiment", "Persuasive", "Humorous"]
max_pom_metrics = {metric: {} for metric in ['acc', 'corr']}
for metric in ['acc', 'corr']:
for sp in split:
max_pom_metrics[metric][sp] = {}
for cls in pom_cls:
max_pom_metrics[metric][sp][cls] = -1
best_pom_mae = {}
for sp in split:
best_pom_mae[sp] = {}
for cls in pom_cls:
best_pom_mae[sp][cls] = 9999