-
Notifications
You must be signed in to change notification settings - Fork 48
/
model_param.py
99 lines (98 loc) · 3.58 KB
/
model_param.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
from tensorflow.keras.applications import EfficientNetB3, EfficientNetB4, EfficientNetB5, EfficientNetB6, EfficientNetB7
'''
# Expected Input shape for EfficientNet Model
Base model resolution
EfficientNetB0 224
EfficientNetB1 240
EfficientNetB2 260
EfficientNetB3 300
EfficientNetB4 380
EfficientNetB5 456
EfficientNetB6 528
EfficientNetB7 600
'''
# Initialise the Model Hyperparameter and training settings used to configure the model.
def model_parameter(selected_model):
model_list = {
"model2": {
"backbone": EfficientNetB4,
"target": 9,
"resize": 380,
"metadata": False,
"initial_lr": 3e-5,
"epochs": 15,
'train_batch_size': 8,
'validation_batch_size': 8,
"savedModelByName": "Model2_EffB4_No_meta.h5",
"saveFinalModelBy": "Model2",
'log_by': "Model2_EffB4_No_meta.csv",
'save_plot_name': 'Model2_EffB4_No_meta',
'prediction_csv_name': 'Model2_EffB4_No_meta_prediction',
'print_hyper_parameter': True,
'input_image_size': 768,
'print_trainable_layers': True,
'print_model_summary': False,
'visualise_augmented_data': False
},
"model10": {
"backbone": EfficientNetB5,
"target": 9,
"resize": 448,
"metadata": False,
"initial_lr": 3e-5,
"epochs": 15,
'input_image_size': 512,
'train_batch_size': 4,
'validation_batch_size': 4,
"savedModelByName": "Model10_EffB5_No_meta.h5",
"saveFinalModelBy": "Model10",
'log_by': "Model10_EffB5_No_meta.csv",
'save_plot_name': 'Model10_EffB5_No_meta',
'prediction_csv_name': 'Model10_EffB5_No_meta_prediction',
'print_hyper_parameter': True,
'print_trainable_layers': False,
'print_model_summary': False,
'visualise_augmented_data': False
},
"model12": {
"backbone": EfficientNetB6,
"target": 9,
"resize": 528,
"metadata": False,
"initial_lr": 3e-5,
"epochs": 15,
'input_image_size': 768,
'train_batch_size': 8,
'validation_batch_size': 8,
"savedModelByName": "Model12_EffB6_No_meta.h5",
"saveFinalModelBy": "Model12",
'log_by': "Model12_EffB6_No_meta.csv",
'save_plot_name': 'Model12_EffB6_No_meta',
'prediction_csv_name': 'Model12_EffB6_No_meta_prediction',
'print_hyper_parameter': True,
'print_trainable_layers': False,
'print_model_summary': False,
'visualise_augmented_data': False
},
"model16": {
"backbone": EfficientNetB7,
"target": 9,
"resize": 380,
"metadata": False,
"initial_lr": 1e-5,
"epochs": 15,
'input_image_size': 768,
'train_batch_size': 4,
'validation_batch_size': 4,
"savedModelByName": "Model16_EffB7_No_meta.h5",
"saveFinalModelBy": "Model16",
'log_by': "Model16_EffB7_No_meta.csv",
'save_plot_name': 'Model16_EffB7_No_meta',
'prediction_csv_name': 'Model16_EffB7_No_meta_prediction',
'print_hyper_parameter': True,
'print_trainable_layers': False,
'print_model_summary': False,
'visualise_augmented_data': False
}
}
return model_list[selected_model]