Passed
Pull Request — master (#1)
by Konstantinos
59s
created

vgg_layers()   B

Complexity

Conditions 1

Size

Total Lines 38
Code Lines 37

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 37
dl 0
loc 38
rs 8.9919
c 0
b 0
f 0
cc 1
nop 0
1
""" 
2
"""
3
def vgg_layers():
4
    """The network's layer structure of the vgg image model."""
5
    return (
6
        (0, 'conv1_1') ,  # (3, 3, 3, 64)
7
        (1, 'relu1_1') ,
8
        (2, 'conv1_2') ,  # (3, 3, 64, 64)
9
        (3, 'relu1_2') ,
10
        (4, 'pool1')   ,
11
        (5, 'conv2_1') ,  # (3, 3, 64, 128)
12
        (6, 'relu2_1') ,
13
        (7, 'conv2_2') ,  # (3, 3, 128, 128)
14
        (8, 'relu2_2') ,
15
        (9, 'pool2')   ,
16
        (10, 'conv3_1'),  # (3, 3, 128, 256)
17
        (11, 'relu3_1'),
18
        (12, 'conv3_2'),  # (3, 3, 256, 256)
19
        (13, 'relu3_2'),
20
        (14, 'conv3_3'),  # (3, 3, 256, 256)
21
        (15, 'relu3_3'),
22
        (16, 'conv3_4'),  # (3, 3, 256, 256)
23
        (17, 'relu3_4'),
24
        (18, 'pool3')  ,
25
        (19, 'conv4_1'),  # (3, 3, 256, 512)
26
        (20, 'relu4_1'),
27
        (21, 'conv4_2'),  # (3, 3, 512, 512)
28
        (22, 'relu4_2'),
29
        (23, 'conv4_3'),  # (3, 3, 512, 512)
30
        (24, 'relu4_3'),
31
        (25, 'conv4_4'),  # (3, 3, 512, 512)
32
        (26, 'relu4_4'),
33
        (27, 'pool4')  ,
34
        (28, 'conv5_1'),  # (3, 3, 512, 512)
35
        (29, 'relu5_1'),
36
        (30, 'conv5_2'),  # (3, 3, 512, 512)
37
        (31, 'relu5_2'),
38
        (32, 'conv5_3'),  # (3, 3, 512, 512)
39
        (33, 'relu5_3'),
40
        (34, 'conv5_4'),  # (3, 3, 512, 512)
41
#         35 is relu
42
#         36 is maxpool
43
#         37 is fullyconnected (7, 7, 512, 4096)
44
#         38 is relu
45
#         39 is fullyconnected (1, 1, 4096, 4096)
46
#         40 is relu
47
#         41 is fullyconnected (1, 1, 4096, 1000)
48
#         42 is softmax
49
    )
50
51
52
LAYERS = tuple((layer_id for _, layer_id in vgg_layers()))
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable layer_id does not seem to be defined.
Loading history...
53