-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
73 lines (59 loc) · 3.25 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
from collections import namedtuple
from models.ResNet import BasicBlock, Bottleneck
ResNetConfig = namedtuple('ResNetConfig', ['block', 'n_blocks', 'channels','cardinality', 'base_width'])
ViTConfig = namedtuple('ViTConfig', ['tokens_type', 'embed_dim','stride', 'depth', 'num_heads', 'mlp_ratio'])
vgg11_config = [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M']
vgg13_config = [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512,
512, 'M']
vgg16_config = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512,
'M', 512, 512, 512, 'M']
vgg19_config = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 512, 512,
512, 512, 'M', 512, 512, 512, 512, 'M']
resnet18_config = ResNetConfig(block = BasicBlock,
n_blocks = [2,2,2,2],
channels = [64, 128, 256, 512],
cardinality = 1,
base_width = 64)
resnet34_config = ResNetConfig(block = BasicBlock,
n_blocks = [3,4,6,3],
channels = [64, 128, 256, 512],
cardinality = 1,
base_width = 64)
resnet50_config = ResNetConfig(block = Bottleneck,
n_blocks = [3, 4, 6, 3],
channels = [64, 128, 256, 512],
cardinality = 1,
base_width = 64)
resnet101_config = ResNetConfig(block = Bottleneck,
n_blocks = [3, 4, 23, 3],
channels = [64, 128, 256, 512],
cardinality = 1,
base_width = 64)
resnext50_32x4d_config = ResNetConfig(block = Bottleneck,
n_blocks = [3, 4, 6, 3],
channels = [64, 128, 256, 512],
cardinality = 32,
base_width = 4)
resnext101_32x4d_config = ResNetConfig(block = Bottleneck,
n_blocks = [3, 4, 23, 3],
channels = [64, 128, 256, 512],
cardinality = 32,
base_width = 4)
t2t_vit_t_12_config = ViTConfig(tokens_type = 'transformer',
embed_dim = 256,
stride = 2,
depth = 12,
num_heads = 4,
mlp_ratio = 2.0)
t2t_vit_t_14_config = ViTConfig(tokens_type = 'transformer',
embed_dim = 384,
stride = 2,
depth = 14,
num_heads = 6,
mlp_ratio = 3.0)
t2t_vit_14_config = ViTConfig(tokens_type = 'performer',
embed_dim = 384,
stride = 2,
depth = 14,
num_heads = 6,
mlp_ratio = 3.0)