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

Function block_inception_b

tests/utils/custom_layers/inception_blocks.py:103–166  ·  view source on GitHub ↗

Builds Inception-B block for Inception v4 network.

(inputs, scope=None, is_train=False)

Source from the content-addressed store, hash-verified

101
102
103def block_inception_b(inputs, scope=None, is_train=False):
104 """Builds Inception-B block for Inception v4 network."""
105 # By default use stride=1 and SAME padding
106
107 with tf.variable_scope(scope, 'BlockInceptionB', [inputs]):
108 with tf.variable_scope('Branch_0'):
109 branch_0, _ = conv_module(
110 inputs, n_out_channel=384, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
111 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1'
112 )
113
114 with tf.variable_scope('Branch_1'):
115 branch_1, _ = conv_module(
116 inputs, n_out_channel=192, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
117 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1'
118 )
119
120 branch_1, _ = conv_module(
121 branch_1, n_out_channel=224, filter_size=(1, 7), strides=(1, 1), padding='SAME', batch_norm_init=None,
122 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0b_1x7'
123 )
124
125 branch_1, _ = conv_module(
126 branch_1, n_out_channel=256, filter_size=(7, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
127 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0c_7x1'
128 )
129
130 with tf.variable_scope('Branch_2'):
131 branch_2, _ = conv_module(
132 inputs, n_out_channel=192, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
133 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1'
134 )
135
136 branch_2, _ = conv_module(
137 branch_2, n_out_channel=192, filter_size=(7, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
138 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0b_7x1'
139 )
140
141 branch_2, _ = conv_module(
142 branch_2, n_out_channel=224, filter_size=(1, 7), strides=(1, 1), padding='SAME', batch_norm_init=None,
143 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0c_1x7'
144 )
145
146 branch_2, _ = conv_module(
147 branch_2, n_out_channel=224, filter_size=(7, 1), strides=(1, 1), padding='SAME', batch_norm_init=None,
148 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0d_7x1'
149 )
150
151 branch_2, _ = conv_module(
152 branch_2, n_out_channel=256, filter_size=(1, 7), strides=(1, 1), padding='SAME', batch_norm_init=None,
153 is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0e_1x7'
154 )
155
156 with tf.variable_scope('Branch_3'):
157 branch_3 = tl.layers.MeanPool2d(
158 inputs, filter_size=(3, 3), strides=(1, 1), padding='SAME', name='AvgPool_0a_3x3'
159 )
160

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…