本文整理汇总了Python中tfcode.tf_utils.custom_residual_block方法的典型用法代码示例。如果您正苦于以下问题:Python tf_utils.custom_residual_block方法的具体用法?Python tf_utils.custom_residual_block怎么用?Python tf_utils.custom_residual_block使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tfcode.tf_utils
的用法示例。
在下文中一共展示了tf_utils.custom_residual_block方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deconv
# 需要导入模块: from tfcode import tf_utils [as 别名]
# 或者: from tfcode.tf_utils import custom_residual_block [as 别名]
def deconv(x, is_training, wt_decay, neurons, strides, layers_per_block,
kernel_size, conv_fn, name, offset=0):
"""Generates a up sampling network with residual connections.
"""
batch_norm_param = {'center': True, 'scale': True,
'activation_fn': tf.nn.relu,
'is_training': is_training}
outs = []
for i, (neuron, stride) in enumerate(zip(neurons, strides)):
for s in range(layers_per_block):
scope = '{:s}_{:d}_{:d}'.format(name, i+1+offset,s+1)
x = custom_residual_block(x, neuron, kernel_size, stride, scope,
is_training, wt_decay, use_residual=True,
residual_stride_conv=True, conv_fn=conv_fn,
batch_norm_param=batch_norm_param)
stride = 1
outs.append((x,True))
return x, outs