-
Notifications
You must be signed in to change notification settings - Fork 2
/
vgg_variants.py
95 lines (75 loc) · 2.77 KB
/
vgg_variants.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
# %%
from configurations.configs import PoolType
from utils.utils import change_pooling
from utils.utils import dump_model_variants_dict
# TODO: Just a single run of this file enough, for all models configure dicts with same context below and dump them to pickle file with dump_model_variants_dict() function
MP = PoolType.MaxPool
FFT = PoolType.FFTPool
DFRFT = PoolType.DFrFTPool
FRFT = PoolType.FrFTPool
CLASS_NAMES = [
"plane",
"car",
"bird",
"cat",
"deer",
"dog",
"frog",
"horse",
"ship",
"truck",
]
# TODO: ilk 3 MP istediğin gibi değiştirince patlamıyor
VGG_11 = [64, MP, 128, MP, 256, 256, MP, 512, 512, MP, 512, 512, MP]
VGG_11_FFT = [64, MP, 128, MP, 256, 256, FFT, 512, 512, MP, 512, 512, MP]
VGG_11_DFRFT = [64, MP, 128, MP, 256, 256, DFRFT, 512, 512, MP, 512, 512, MP]
VGG_11_FRFT = [64, MP, 128, MP, 256, 256, FRFT, 512, 512, MP, 512, 512, MP]
VGG_13 = [64, 64, MP, 128, 128, MP, 256, 256, MP, 512, 512, MP, 512, 512, MP]
VGG_13_FFT = [64, 64, MP, 128, 128, MP, 256, 256, FFT, 512, 512, MP, 512, 512, MP]
VGG_13_FRFT = [64, 64, MP, 128, 128, MP, 256, 256, FRFT, 512, 512, MP, 512, 512, MP]
VGG_13_DFRFT = [64, 64, MP, 128, 128, MP, 256, 256, DFRFT, 512, 512, MP, 512, 512, MP]
VGG_16_1 = [64, 64, MP, 128, 128, MP, 256, 256, 256, MP]
VGG_16_2 = [512, 512, 512, MP, 512, 512, 512, MP]
VGG_16 = VGG_16_1 + VGG_16_2
VGG_16_FFT = [64, 64, MP, 128, 128, MP, 256, 256, 256, FFT] + VGG_16_2
VGG_16_FRFT = [64, 64, MP, 128, 128, MP, 256, 256, 256, FRFT] + VGG_16_2
VGG_16_DFRFT = [64, 64, MP, 128, 128, MP, 256, 256, 256, DFRFT] + VGG_16_2
VGG_LAYER_DICT = {
"VGG_11": VGG_11,
"VGG_11_FFT": VGG_11_FFT,
"VGG_11_FRFT": VGG_11_FRFT,
"VGG_11_DFRFT": VGG_11_DFRFT,
"VGG_13":VGG_13,
"VGG_13_FFT":VGG_13_FFT,
"VGG_13_FRFT":VGG_13_FRFT,
"VGG_13_DFRFT":VGG_13_DFRFT,
"VGG_16": VGG_16,
"VGG_16_FFT": VGG_16_FFT,
"VGG_16_FRFT": VGG_16_FRFT,
"VGG_16_DFRFT": VGG_16_DFRFT,
}
# VGG_13 = [64, 64, MP, 128, 128, MP, 256, 256, MP, 512, 512, MP, 512, 512, MP]
# VGG_19_1 = [64, 64, MP, 128, 128, MP, 256, 256, 256, 256]
# VGG_19_2 = [MP, 512, 512, 512, 512, MP, 512, 512, 512, 512, MP]
# VGG_19 = VGG_19_1 + VGG_19_2
# asdasd
# VGG_LAYER_DICT = {
# "VGG_11": VGG_11,
# "VGG_13": VGG_13,
# "VGG_16": VGG_16,
# "VGG_19": VGG_19,
# "VGG_11_FFT": VGG_11_FFT,
# "VGG_13_FFT": VGG_13_FFT,
# "VGG_16_FFT": VGG_16_FFT,
# "VGG_19_FFT": VGG_19_FFT,
# "VGG_11_FRFT": VGG_11_FRFT,
# "VGG_13_FRFT": VGG_13_FRFT,
# "VGG_16_FRFT": VGG_16_FRFT,
# "VGG_19_FRFT": VGG_19_FRFT,
# "VGG_11_DFRFT": VGG_11_DFRFT,
# "VGG_13_DFRFT": VGG_13_DFRFT,
# "VGG_16_DFRFT": VGG_16_DFRFT,
# "VGG_19_DFRFT": VGG_19_DFRFT,
# }
dump_model_variants_dict(model_name="vgg", model_variants_dict=VGG_LAYER_DICT)
# %%