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

Function block_reduction_b

tests/utils/custom_layers/inception_blocks.py:169–209  ·  view source on GitHub ↗

Builds Reduction-B block for Inception v4 network.

(inputs, scope=None, is_train=False)

Source from the content-addressed store, hash-verified

167
168
169def block_reduction_b(inputs, scope=None, is_train=False):
170 """Builds Reduction-B block for Inception v4 network."""
171 # By default use stride=1 and SAME padding
172
173 with tf.variable_scope(scope, 'BlockReductionB', [inputs]):
174 with tf.variable_scope('Branch_0'):
175 branch_0, _ = conv_module(
176 inputs, n_out_channel=192, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
177 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1'
178 )
179
180 branch_0, _ = conv_module(
181 branch_0, n_out_channel=192, filter_size=(3, 3), strides=(2, 2), padding='VALID', batch_norm_init=None,
182 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_1a_3x3'
183 )
184
185 with tf.variable_scope('Branch_1'):
186 branch_1, _ = conv_module(
187 inputs, n_out_channel=256, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
188 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1'
189 )
190
191 branch_1, _ = conv_module(
192 branch_1, n_out_channel=256, filter_size=(1, 7), strides=(1, 1), padding='SAME', batch_norm_init=None,
193 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0b_1x7'
194 )
195
196 branch_1, _ = conv_module(
197 branch_1, n_out_channel=320, filter_size=(7, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
198 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0c_7x1'
199 )
200
201 branch_1, _ = conv_module(
202 branch_1, n_out_channel=320, filter_size=(3, 3), strides=(2, 2), padding='VALID', batch_norm_init=None,
203 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_1a_3x3'
204 )
205
206 with tf.variable_scope('Branch_2'):
207 branch_2 = tl.layers.MaxPool2d(inputs, (3, 3), strides=(2, 2), padding='VALID', name='MaxPool_1a_3x3')
208
209 return tl.layers.ConcatLayer([branch_0, branch_1, branch_2], concat_dim=3, name='concat_layer')
210
211
212def block_inception_c(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…