From 87b33f29817072257b650373023746b0da1d9827 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Tue, 4 Aug 2020 08:07:16 +0000 Subject: [PATCH] fix typo --- ppcls/modeling/architectures/resnet.py | 10 +++++----- ppcls/modeling/architectures/resnet_vc.py | 10 +++++----- ppcls/modeling/architectures/se_resnet_vd.py | 16 ++++++++++------ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ppcls/modeling/architectures/resnet.py b/ppcls/modeling/architectures/resnet.py index 40b6c5cf..3e0f1187 100644 --- a/ppcls/modeling/architectures/resnet.py +++ b/ppcls/modeling/architectures/resnet.py @@ -124,14 +124,14 @@ class BottleneckBlock(fluid.dygraph.Layer): return layer_helper.append_activation(y) -class BisicBlock(fluid.dygraph.Layer): +class BasicBlock(fluid.dygraph.Layer): def __init__(self, num_channels, num_filters, stride, shortcut=True, name=None): - super(BisicBlock, self).__init__() + super(BasicBlock, self).__init__() self.stride = stride self.conv0 = ConvBNLayer( num_channels=num_channels, @@ -231,16 +231,16 @@ class ResNet(fluid.dygraph.Layer): shortcut = False for i in range(depth[block]): conv_name = "res" + str(block + 2) + chr(97 + i) - bisic_block = self.add_sublayer( + basic_block = self.add_sublayer( conv_name, - BisicBlock( + BasicBlock( num_channels=num_channels[block] if i == 0 else num_filters[block], num_filters=num_filters[block], stride=2 if i == 0 and block != 0 else 1, shortcut=shortcut, name=conv_name)) - self.block_list.append(bisic_block) + self.block_list.append(basic_block) shortcut = True self.pool2d_avg = Pool2D( diff --git a/ppcls/modeling/architectures/resnet_vc.py b/ppcls/modeling/architectures/resnet_vc.py index ade9dc4e..b568d020 100644 --- a/ppcls/modeling/architectures/resnet_vc.py +++ b/ppcls/modeling/architectures/resnet_vc.py @@ -126,14 +126,14 @@ class BottleneckBlock(fluid.dygraph.Layer): return layer_helper.append_activation(y) -class BisicBlock(fluid.dygraph.Layer): +class BasicBlock(fluid.dygraph.Layer): def __init__(self, num_channels, num_filters, stride, shortcut=True, name=None): - super(BisicBlock, self).__init__() + super(BasicBlock, self).__init__() self.stride = stride self.conv0 = ConvBNLayer( num_channels=num_channels, @@ -248,16 +248,16 @@ class ResNet_vc(fluid.dygraph.Layer): shortcut = False for i in range(depth[block]): conv_name = "res" + str(block + 2) + chr(97 + i) - bisic_block = self.add_sublayer( + basic_block = self.add_sublayer( 'bb_%d_%d' % (block, i), - BisicBlock( + BasicBlock( num_channels=num_channels[block] if i == 0 else num_filters[block], num_filters=num_filters[block], stride=2 if i == 0 and block != 0 else 1, shortcut=shortcut, name=conv_name)) - self.block_list.append(bisic_block) + self.block_list.append(basic_block) shortcut = True self.pool2d_avg = Pool2D( diff --git a/ppcls/modeling/architectures/se_resnet_vd.py b/ppcls/modeling/architectures/se_resnet_vd.py index 3267bb4c..7e25a80b 100644 --- a/ppcls/modeling/architectures/se_resnet_vd.py +++ b/ppcls/modeling/architectures/se_resnet_vd.py @@ -45,7 +45,11 @@ class ConvBNLayer(fluid.dygraph.Layer): self.is_vd_mode = is_vd_mode self._pool2d_avg = Pool2D( - pool_size=2, pool_stride=2, pool_padding=0, pool_type='avg', ceil_mode=True) + pool_size=2, + pool_stride=2, + pool_padding=0, + pool_type='avg', + ceil_mode=True) self._conv = Conv2D( num_channels=num_channels, num_filters=num_filters, @@ -139,7 +143,7 @@ class BottleneckBlock(fluid.dygraph.Layer): return layer_helper.append_activation(y) -class BisicBlock(fluid.dygraph.Layer): +class BasicBlock(fluid.dygraph.Layer): def __init__(self, num_channels, num_filters, @@ -148,7 +152,7 @@ class BisicBlock(fluid.dygraph.Layer): if_first=False, reduction_ratio=16, name=None): - super(BisicBlock, self).__init__() + super(BasicBlock, self).__init__() self.stride = stride self.conv0 = ConvBNLayer( num_channels=num_channels, @@ -313,9 +317,9 @@ class SE_ResNet_vd(fluid.dygraph.Layer): shortcut = False for i in range(depth[block]): conv_name = "res" + str(block + 2) + chr(97 + i) - bisic_block = self.add_sublayer( + basic_block = self.add_sublayer( 'bb_%d_%d' % (block, i), - BisicBlock( + BasicBlock( num_channels=num_channels[block] if i == 0 else num_filters[block], num_filters=num_filters[block], @@ -323,7 +327,7 @@ class SE_ResNet_vd(fluid.dygraph.Layer): shortcut=shortcut, if_first=block == i == 0, name=conv_name)) - self.block_list.append(bisic_block) + self.block_list.append(basic_block) shortcut = True self.pool2d_avg = Pool2D( -- GitLab