def block8(x, scale=1.0, activation_fn=tf.nn.relu, scope=None, reuse=None):
"""Builds the 8x8 ResNet block."""
with tf.variable_scope(scope, 'Block8', [x], reuse=reuse):
with tf.variable_scope('Branch_0'):
tower_conv = slim.conv2d(x, 192, 1, scope='Conv2d_1x1')
with tf.variable_scope('Branch_1'):
tower_conv1_0 = slim.conv2d(x, 192, 1, scope='Conv2d_0a_1x1')
tower_conv1_1 = slim.conv2d(tower_conv1_0, 224, [1, 3], scope='Conv2d_0b_1x3')
tower_conv1_2 = slim.conv2d(tower_conv1_1, 256, [3, 1], scope='Conv2d_0c_3x1')
mixed = tf.concat(values=[tower_conv, tower_conv1_2], axis=3)
up = slim.conv2d(mixed, x.get_shape()[3], 1,
normalizer_fn=None,
activation_fn=None,
scope='Conv2d_1x1')
x += scale * up
if activation_fn:
x = activation_fn(x)
return x
# Reduce-A
# (3 branches)
inception_resnet_v2_original.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录