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

Function block_reduction_a

tests/utils/custom_layers/inception_blocks.py:70–100  ·  view source on GitHub ↗

Builds Reduction-A block for Inception v4 network.

(inputs, scope=None, is_train=False)

Source from the content-addressed store, hash-verified

68
69
70def block_reduction_a(inputs, scope=None, is_train=False):
71 """Builds Reduction-A block for Inception v4 network."""
72 # By default use stride=1 and SAME padding
73
74 with tf.variable_scope(scope, 'BlockReductionA', [inputs]):
75 with tf.variable_scope('Branch_0'):
76 branch_0, _ = conv_module(
77 inputs, n_out_channel=384, filter_size=(3, 3), strides=(2, 2), padding='VALID', batch_norm_init=None,
78 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_1a_3x3'
79 )
80
81 with tf.variable_scope('Branch_1'):
82 branch_1, _ = conv_module(
83 inputs, n_out_channel=192, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
84 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1'
85 )
86
87 branch_1, _ = conv_module(
88 branch_1, n_out_channel=224, filter_size=(3, 3), strides=(1, 1), padding='SAME', batch_norm_init=None,
89 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0b_3x3'
90 )
91
92 branch_1, _ = conv_module(
93 branch_1, n_out_channel=256, filter_size=(3, 3), strides=(2, 2), padding='VALID', batch_norm_init=None,
94 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_1a_3x3'
95 )
96
97 with tf.variable_scope('Branch_2'):
98 branch_2 = tl.layers.MaxPool2d(inputs, (3, 3), strides=(2, 2), padding='VALID', name='MaxPool_1a_3x3')
99
100 return tl.layers.ConcatLayer([branch_0, branch_1, branch_2], concat_dim=3, name='concat_layer')
101
102
103def block_inception_b(inputs, scope=None, is_train=False):

Callers 1

__call__Method · 0.90

Calls 1

conv_moduleFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…