def block(x, n_in, n_out, subsample, phase_train, scope='res_block'):
with tf.variable_scope(scope):
if subsample:
y = conv2d(x, n_in, n_out, 3, 2, 'SAME', False,phase_train, scope='conv_1')
else:
y = conv2d(x, n_in, n_out, 3, 1, 'SAME', False,phase_train, scope='conv_1')
y = \
batch_norm(y, n_out, phase_train, scope='bn_1')
y = tf.mul(tf.sign(y),tf.sqrt(tf.abs(y)+1e-5) + 0.1)
y = conv2d(y, n_out, n_out, 3, 1, 'SAME', False, phase_train, scope='conv_2')
y = batch_norm(y, n_out, phase_train, scope='bn_2')
y = tf.mul(tf.sign(y), tf.sqrt(tf.abs(y)+1e-5) + 0.1)
return y
model_cifar_contract.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录