def get_inception_layer( inputs, conv11_size, conv33_11_size, conv33_size,
conv55_11_size, conv55_size, pool11_size ):
with tf.variable_scope("conv_1x1"):
conv11 = layers.conv2d( inputs, conv11_size, [ 1, 1 ] )
with tf.variable_scope("conv_3x3"):
conv33_11 = layers.conv2d( inputs, conv33_11_size, [ 1, 1 ] )
conv33 = layers.conv2d( conv33_11, conv33_size, [ 3, 3 ] )
with tf.variable_scope("conv_5x5"):
conv55_11 = layers.conv2d( inputs, conv55_11_size, [ 1, 1 ] )
conv55 = layers.conv2d( conv55_11, conv55_size, [ 5, 5 ] )
with tf.variable_scope("pool_proj"):
pool_proj = layers.max_pool2d( inputs, [ 3, 3 ], stride = 1 )
pool11 = layers.conv2d( pool_proj, pool11_size, [ 1, 1 ] )
if tf.__version__ == '0.11.0rc0':
return tf.concat(3, [conv11, conv33, conv55, pool11])
return tf.concat([conv11, conv33, conv55, pool11], 3)
评论列表
文章目录