Builds Inception-C block for Inception v4 network.
(inputs, scope=None, is_train=False)
| 210 | |
| 211 | |
| 212 | def block_inception_c(inputs, scope=None, is_train=False): |
| 213 | """Builds Inception-C block for Inception v4 network.""" |
| 214 | # By default use stride=1 and SAME padding |
| 215 | |
| 216 | with tf.variable_scope(scope, 'BlockInceptionC', [inputs]): |
| 217 | with tf.variable_scope('Branch_0'): |
| 218 | branch_0, _ = conv_module( |
| 219 | inputs, n_out_channel=256, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 220 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1' |
| 221 | ) |
| 222 | |
| 223 | with tf.variable_scope('Branch_1'): |
| 224 | branch_1, _ = conv_module( |
| 225 | inputs, n_out_channel=384, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 226 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1' |
| 227 | ) |
| 228 | |
| 229 | branch_1a, _ = conv_module( |
| 230 | branch_1, n_out_channel=256, filter_size=(1, 3), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 231 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0b_1x3' |
| 232 | ) |
| 233 | |
| 234 | branch_1b, _ = conv_module( |
| 235 | branch_1, n_out_channel=256, filter_size=(3, 1), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 236 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0c_3x1' |
| 237 | ) |
| 238 | |
| 239 | branch_1 = tl.layers.ConcatLayer([branch_1a, branch_1b], concat_dim=3, name='concat_layer') |
| 240 | |
| 241 | with tf.variable_scope('Branch_2'): |
| 242 | branch_2, _ = conv_module( |
| 243 | inputs, n_out_channel=384, filter_size=(1, 1), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 244 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0a_1x1' |
| 245 | ) |
| 246 | |
| 247 | branch_2, _ = conv_module( |
| 248 | branch_2, n_out_channel=448, filter_size=(3, 1), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 249 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0b_3x1' |
| 250 | ) |
| 251 | |
| 252 | branch_2, _ = conv_module( |
| 253 | branch_2, n_out_channel=512, filter_size=(1, 3), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 254 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0c_1x3' |
| 255 | ) |
| 256 | |
| 257 | branch_2a, _ = conv_module( |
| 258 | branch_2, n_out_channel=256, filter_size=(1, 3), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 259 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0d_1x3' |
| 260 | ) |
| 261 | |
| 262 | branch_2b, _ = conv_module( |
| 263 | branch_2, n_out_channel=256, filter_size=(3, 1), strides=(1, 1), padding='SAME', batch_norm_init=None, |
| 264 | is_train=is_train, use_batchnorm=True, activation_fn='ReLU', name='Conv2d_0e_3x1' |
| 265 | ) |
| 266 | |
| 267 | branch_2 = tl.layers.ConcatLayer([branch_2a, branch_2b], concat_dim=3, name='concat_layer') |
| 268 | |
| 269 | with tf.variable_scope('Branch_3'): |
no test coverage detected
searching dependent graphs…