-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py
executable file
·135 lines (122 loc) · 6.67 KB
/
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
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
import torch
from data import resnet_features,kinematic_feature_names, kinematic_feature_names_no_ori, colin_features, segmentation_features, kinematic_feature_names_jigsaws, kinematic_feature_names_jigsaws_patient_position, class_names, all_class_names, state_variables
RECORD_RESULTS = True
tcn_model_params = {
"class_num": 7,
"decoder_params": {
"input_size": 256,
"kernel_size": 61,
"layer_sizes": [
96,
64,
# 64
],
"layer_type": "TempConv",
"norm_type": "Channel",
"transposed_conv": True
},
"encoder_params": {
"input_size": 25,
"kernel_size": 61,
"layer_sizes": [
64,
256,
# 128
],
"layer_type": "TempConv",
"norm_type": "Channel"
},
"fc_size": 32,
"mid_lstm_params": {
"hidden_size": 64,
"input_size": 256,
"layer_num": 1
}
}
transformer_params = {
"d_model": 60,
"nhead": 3,
"num_layers": 2,
"hidden_dim": 128,
"layer_dim": 4,
"encoder_params": { #some of these gets updated during runtime based on the feature dimension of the given data
"in_channels": 14,
"kernel_size": 31,
"out_channels": 60,
},
"decoder_params": {
"in_channels": 60,
"kernel_size": 31,
"out_channels": 60
},
}
learning_params = {
# "lr": 8.906324028628413e-5,
"lr": 1e-05,
"epochs": 20,
"weight_decay": 1e-4,
"patience": 3
}
dataloader_params = {
"batch_size": 10,
"one_hot": True,
"device": torch.device("cuda" if torch.cuda.is_available() else "cpu"),
"observation_window": 30,
"prediction_window": 10,
"user_left_out": 7,
"cast": True,
"include_image_features": False,
"normalizer": '', # ('standardization', 'min-max', 'power', '')
"step": 1, # 1 - 30 Hz
"context": 9 # 0-nocontext, 1-contextonly, 2-context+kin, 3-imageonly, 4-image+kin, 5-image+kin+context, 6-colin_features, 7- colin+context, 8-colin+kin, 9-colin+kin+context, 10-segonly, 11-kin+seg, 12-kin+seg+context, 13-kin+seg+context+colins, 14-seg+colins
# hamid - do not need (1,3,5,7)
}
# --context
# modality_mapping = { # combination of kinematics and state, include_resnet, include_colin, include_segment
# 0: kinematic_feature_names_jigsaws[38:], # Kinematic (38)
# 1: kinematic_feature_names_jigsaws_patient_position, # Kinematic (14)
# 2: state_variables, # Context (GT)
# 3: colin_features, # Colins Features
# 4: resnet_features, # ResNet50 Features
# 5: segmentation_features, # Segmentation Masks Features
# 6: state_variables + colin_features, # Context(GT) + Colins Features
# 7: kinematic_feature_names_jigsaws[38:] + state_variables, # Kinematic (38) + Context(GT)
# 8: kinematic_feature_names_jigsaws_patient_position + state_variables, # Kinematic (14) + Context(GT)
# 9: kinematic_feature_names_jigsaws[38:] + colin_features, # Kinematic (38) + Colins Features
# 10: kinematic_feature_names_jigsaws_patient_position + colin_features, # Kinematic (14) + Colins Features
# 11: kinematic_feature_names_jigsaws[38:] + resnet_features, # Kinematic (38) + ResNet50
# 12: kinematic_feature_names_jigsaws_patient_position + resnet_features, # Kinematic (14) + ResNet50
# 13: kinematic_feature_names_jigsaws[38:] + segmentation_features, # Kinematic (38) + Segmentation Masks
# 14: kinematic_feature_names_jigsaws_patient_position + segmentation_features, # Kinematic (14) + Segmentation Masks
# 15: kinematic_feature_names_jigsaws[38:] + state_variables + colin_features, # Kinematic (38) + Context(GT) + Colins Features
# 16: kinematic_feature_names_jigsaws_patient_position + state_variables + colin_features, # Kinematic (14) + Context(GT) + Colins Features
# 17: kinematic_feature_names_jigsaws[38:] + segmentation_features + state_variables, # Kinematic (38) + Segmentation Masks + Context(GT)
# 18: kinematic_feature_names_jigsaws_patient_position + segmentation_features + state_variables, # Kinematic (14) + Segmentation Masks + Context(GT)
# 19: kinematic_feature_names_jigsaws[38:] + segmentation_features + state_variables, # Kinematic (38) + Segmentation Masks + Context(GT) + Colins
# 20: kinematic_feature_names_jigsaws_patient_position + segmentation_features + state_variables, # Kinematic (14) + Segmentation Masks + Context(GT) + Colins
# 21: kinematic_feature_names_jigsaws_patient_position + resnet_features, # Kinematic (14) + Resnet
# }
modality_mapping = { # combination of kinematics and state, include_resnet, include_colin, include_segment
0: (kinematic_feature_names, False, False, False), # Kinematic (38)
1: (kinematic_feature_names_no_ori, False, False, False), # Kinematic (14)
# 2: (state_variables), # Context (GT)
# 3: colin_features, # Colins Features
# 4: resnet_features, # ResNet50 Features
# 5: segmentation_features, # Segmentation Masks Features
# 6: state_variables + colin_features, # Context(GT) + Colins Features
7: (kinematic_feature_names + state_variables, False, False, False), # Kinematic (38) + Context(GT)
8: (kinematic_feature_names_no_ori + state_variables, False, False, False), # Kinematic (14) + Context(GT)
9: (kinematic_feature_names, False, True, False), # Kinematic (38) + Colins Features
10: (kinematic_feature_names_no_ori, False, True, False), # Kinematic (14) + Colins Features
11: (kinematic_feature_names, True, False, False), # Kinematic (38) + ResNet50
12: (kinematic_feature_names_no_ori, True, False, False), # Kinematic (14) + ResNet50
13: (kinematic_feature_names, False, False, True), # Kinematic (38) + Segmentation Masks
14: (kinematic_feature_names_no_ori, False, False, True), # Kinematic (14) + Segmentation Masks
15: (kinematic_feature_names + state_variables, False, True, False), # Kinematic (38) + Context(GT) + Colins Features
16: (kinematic_feature_names_no_ori + state_variables, False, True, False), # Kinematic (14) + Context(GT) + Colins Features
17: (kinematic_feature_names + state_variables, False, False, True), # Kinematic (38) + Segmentation Masks + Context(GT)
18: (kinematic_feature_names_no_ori + state_variables, False, False, True), # Kinematic (14) + Segmentation Masks + Context(GT)
19: (kinematic_feature_names + state_variables, False, True, True), # Kinematic (38) + Segmentation Masks + Context(GT) + Colins
20: (kinematic_feature_names_no_ori + state_variables, False, True, True), # Kinematic (14) + Segmentation Masks + Context(GT) + Colins
21: (kinematic_feature_names_no_ori, True, False, False), # Kinematic (14) + Resnet
}