33ResNet
44-------------------------------
55
6- .. py :class :: paddle.vision.models.ResNet(Block, depth = 50 , width = 64 , num_classes = 1000 , with_pool = True )
6+ .. py :class :: paddle.vision.models.ResNet(Block, depth = 50 , width = 64 , num_classes = 1000 , with_pool = True , groups = 1 )
77
88 ResNet模型,来自论文 `"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf >`_ 。
99
1010参数
1111:::::::::
1212 - **Block ** (BasicBlock|BottleneckBlock) - 模型的残差模块。
1313 - **depth ** (int,可选) - resnet模型的深度。默认值:50。
14- - **groups ** (int,可选) - 各个卷积块的分组数。默认值:1。
15- - **width_per_group ** (int,可选) - 各个卷积块的每个卷积组基础宽度。默认值:64。
14+ - **width ** (int,可选) - 各个卷积块的每个卷积组基础宽度。默认值:64。
1615 - **num_classes ** (int, 可选) - 最后一个全连接层输出的维度。如果该值小于0,则不定义最后一个全连接层。默认值:1000。
1716 - **with_pool ** (bool,可选) - 是否定义最后一个全连接层之前的池化层。默认值:True。
17+ - **groups ** (int,可选) - 各个卷积块的分组数。默认值:1。
1818
1919返回
2020:::::::::
@@ -35,10 +35,10 @@ ResNet模型,Layer的实例。
3535 resnet50 = ResNet(BottleneckBlock, 50 )
3636
3737 # build Wide ResNet model
38- wide_resnet50_2 = ResNet(BottleneckBlock, 50 , width_per_group = 64 * 2 )
38+ wide_resnet50_2 = ResNet(BottleneckBlock, 50 , width = 64 * 2 )
3939
4040 # build ResNeXt model
41- resnext50_32x4d = ResNet(BottleneckBlock, 50 , groups = 32 , width_per_group = 4 )
41+ resnext50_32x4d = ResNet(BottleneckBlock, 50 , width = 4 , groups = 32 )
4242
4343 x = paddle.rand([1 , 3 , 224 , 224 ])
4444 out = resnet18(x)
0 commit comments