-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
123 lines (112 loc) · 2.7 KB
/
constants.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
import os as _os
# project structure
ROOT_DIR = _os.path.dirname(_os.path.abspath(__file__))
RESULTS_DIR = _os.path.join(ROOT_DIR, 'results/')
DATA_DIR = _os.environ.get("REY_FIGURE_DATA")
RESOURCES_DIR = _os.path.join(ROOT_DIR, 'resources/')
# architectures
REYCLASSIFIER_3 = 'rey-classifier-3'
REYCLASSIFIER_4 = 'rey-classifier-4'
REYMULTICLASSIFIER = 'rey-multilabel-classifier'
WIDE_RESNET50_2 = 'wide-resnet50-2'
REYREGRESSOR = 'rey-regressor'
# data
USER_RATING_DATA_DIR = 'UserRatingData'
MAIN_LABEL_FILENAME = '{split}-labels.csv'
FOTO_FOLDERS = ['Typeform', 'USZ_fotos']
TEST_FRACTION = 0.2
DATADIR_SMALL = './data/serialized-data/data_116x150-seed_1'
DATADIR_BIG = './data/serialized-data/data_232x300-seed_1'
N_ITEMS = 18
ITEM_SCORES_3 = [0, 1, 2]
ITEM_SCORES_4 = [0, 0.5, 1, 2]
DEFAULT_CANVAS_SIZE = (116, 150)
DEFAULT_CANVAS_SIZE_BIG = (232, 300)
AUGM_CANVAS_SIZE = (464, 600)
CLASSIFICATION_LABELS = 'classification_labels'
REGRESSION_LABELS = 'regression_labels'
# semantic transformations
TF_ROTATION = 'rotation'
TF_PERSPECTIVE = 'perspective'
TF_BRIGHTNESS = 'brightness'
TF_CONTRAST = 'contrast'
# results
SCORE_COLUMNS = [f'score_item_{i + 1}' for i in range(N_ITEMS)]
CLASS_COLUMNS = [f'class_item_{i + 1}' for i in range(N_ITEMS)]
ABSOLUTE_ERROR = 'absolute_error'
SQUARED_ERROR = 'squared_error'
NUM_MISCLASS = 'num_misclassified'
R_SQUARED = 'r_squared'
ERR_LEVEL_TOTAL_SCORE = 'total_score'
ERR_LEVEL_ITEM_SCORE = 'item_score'
# confidence for confidence intervals
CI_CONFIDENCE = 0.95
ERROR_TO_LABEL = {
NUM_MISCLASS: '# Misclassified Items',
ABSOLUTE_ERROR: 'Mean Absolute Error (MAE)',
SQUARED_ERROR: 'Mean Squared Error (MSE)',
R_SQUARED: r'$R^2$'
}
# score bins
BIN_LOCATIONS1_V2 = [-1, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36]
BIN_LOCATIONS2_V2 = [-1, 6, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36]
BIN_LOCATIONS3_V2 = [-1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36]
BIN_LOCATIONS1 = [
(0, 14),
(14, 16),
(16, 18),
(18, 20),
(20, 22),
(22, 24),
(24, 26),
(26, 28),
(28, 30),
(30, 32),
(32, 34),
(34, 36),
(36, 37)
]
BIN_LOCATIONS2 = [
(0, 6),
(6, 12),
(12, 14),
(14, 16),
(16, 18),
(18, 20),
(20, 22),
(22, 24),
(24, 26),
(26, 28),
(28, 30),
(30, 32),
(32, 34),
(34, 36),
(36, 37)
]
BIN_LOCATIONS_DENSE = [
(0, 7),
(7, 14),
(14, 15),
(15, 16),
(16, 17),
(17, 18),
(18, 19),
(19, 20),
(20, 21),
(21, 22),
(22, 23),
(23, 24),
(24, 25),
(25, 26),
(26, 27),
(27, 28),
(28, 29),
(29, 30),
(30, 31),
(31, 32),
(32, 33),
(33, 34),
(34, 35),
(35, 36),
(36, 37)
]