MCPcopy
hub / github.com/tensorlayer/TensorLayer / get_model

Method get_model

tests/layers/test_layernode.py:31–54  ·  view source on GitHub ↗
(input_shape)

Source from the content-addressed store, hash-verified

29 print('-' * 20, 'test_net1', '-' * 20)
30
31 def get_model(input_shape):
32 ni = Input(input_shape)
33
34 nii = Conv2d(32, filter_size=(3, 3), strides=(1, 1), name='conv1')(ni)
35 nn = Dropout(keep=0.9, name='drop1')(nii)
36
37 conv = Conv2d(32, filter_size=(3, 3), strides=(1, 1), name='conv2')
38 tt = conv(nn) # conv2_node_0
39 nn = conv(nn) # conv2_node_1
40
41 # a branch
42 na = Conv2d(64, filter_size=(3, 3), strides=(1, 1), name='conv3')(nn)
43 na = MaxPool2d(name='pool1')(na)
44
45 # b branch
46 nb = MaxPool2d(name='pool2')(nn)
47 nb = conv(nb) # conv2_node_2
48
49 out = Concat(name='concat')([na, nb])
50 M = Model(inputs=ni, outputs=[out, nn, nb])
51
52 gg = conv(nii) # this node will not be added since model fixed
53
54 return M
55
56 net = get_model([None, 24, 24, 3])
57

Callers

nothing calls this directly

Calls 9

ModelClass · 0.90
InputFunction · 0.85
Conv2dClass · 0.85
DropoutClass · 0.85
MaxPool2dClass · 0.85
ConcatClass · 0.85
FlattenClass · 0.85
DenseClass · 0.85

Tested by

no test coverage detected