resnet
论文:https://arxiv.org/pdf/1512.03385.pdf
翻译转载:https://blog.youkuaiyun.com/Quincuntial/article/details/77263562
网络结构1:https://blog.youkuaiyun.com/nima1994/article/details/82686132
网络结构2:https://blog.youkuaiyun.com/seven_year_promise/article/details/69360488
这几天看了tensorflow搭建的resnet模型,十分的干净利落。将结合代码的分析记录,以防遗忘。
模型位于 /tensorflow/model/research/slim/nets/resnet_v1.py
在该文件中可以直接找到 resnet_v1_50 函数,这是最基础的resnet网络模型,与101,152的结构是一致的,所以就此进行分析。
def resnet_v1_50(inputs,
num_classes=None,
is_training=True,
global_pool=True,
output_stride=None,
spatial_squeeze=True,
store_non_strided_activations=False,
reuse=None,
scope='resnet_v1_50'):
"""ResNet-50 model of [1]. See resnet_v1() for arg and return description."""
blocks = [
resnet_v1_block('block1', base_depth=64, num_units=3, stride=2),
resnet_v1_block('block2', base_depth=128, num_units=4, stride=2),
resnet_v1_block('block3', base_depth=256, num_units=6, stride=2),
resnet_v1_block('block4', base_depth=512, num_units=3, stride=1),
]
return resnet_v1(inputs, blocks, num_classes, is_training,
global_pool=global_pool, output_stride=output_stride,
include_root_block=True, spatial_squeeze=spatial_squeeze,
store_non_strided_activations=store_non_strided_activations,
reuse=reuse, scope=scope)
resnet_v1_50.default_image_size = resnet_v1.default_image_size
可以看到该blocks直接由4个resnet_v1_block顺次构成,好简洁。。。结合论文中给出了网络结构模型进行分析。

可以看到论文中resnet50的resnet模块就是3,4,6,3的分布卷积核数目分别是64,128,256,512,这一部分意义印证。
接下来进入到 resnet_v1_block 函数
def resnet_v1_block(scope, base_depth, num_units, stride):
"""Helper function for creating a resnet_v1 bottleneck block.
Args:
scope: The scope of the block.
base_depth: The depth of the bottleneck layer for each unit.
num_units: The number of units in the block.
stride: The stride

本文档详细分析了使用TensorFlow构建的ResNet模型,主要聚焦于resnet_v1_50函数,该函数构建了基础的ResNet网络结构。ResNet网络由四个resnet_v1_block组成,对应于论文中3,4,6,3的卷积核分布。在resnet_v1_block函数中,参数传递至bottleneck层,完成下采样的准备工作。最后,通过resnet_utils.stack_blocks_dense将模块整合进网络。尽管已有关于ResNet的文章,但本文提供了独特的视角和理解。"
123714775,12883050,Spherical Convolution:3D特征提取的新方法,"['计算机视觉', '深度学习', '3D卷积', '点云处理', '神经网络']
最低0.47元/天 解锁文章
524

被折叠的 条评论
为什么被折叠?



