code
stringlengths
17
6.64M
def conv_out(in_planes, out_planes): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=1, bias=False)
def recurrent_conv(in_planes, out_planes): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=1, padding=1, groups=1, bias=False)
def _make_divisible(v: float, divisor: int, min_value: Optional[int]=None) -> int: '\n This function is taken from the original tf repo.\n It ensures that all layers have a channel number that is divisible by 8\n It can be seen here:\n https://github.com/tensorflow/models/blob/master/research/slim/net...
class ConvBNReLU(nn.Sequential): def __init__(self, in_planes: int, out_planes: int, kernel_size: int=3, stride: int=1, groups: int=1, norm_layer: Optional[Callable[(..., nn.Module)]]=None) -> None: padding = ((kernel_size - 1) // 2) if (norm_layer is None): norm_layer = nn.BatchNorm2...
class InvertedResidual(nn.Module): def __init__(self, inp: int, oup: int, stride: int, expand_ratio: int, rla_channel: int, norm_layer: Optional[Callable[(..., nn.Module)]]=None, ECA_ksize=None) -> None: super(InvertedResidual, self).__init__() self.stride = stride assert (stride in [1, 2...
class RLA_MobileNetV2(nn.Module): def __init__(self, num_classes: int=1000, width_mult: float=1.0, rla_channel: int=32, inverted_residual_setting: Optional[List[List[int]]]=None, round_nearest: int=8, block: Optional[Callable[(..., nn.Module)]]=None, norm_layer: Optional[Callable[(..., nn.Module)]]=None, ECA=Fal...
def rla_mobilenetv2(rla_channel=32): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2......') model = RLA_MobileNetV2(rla_channel=rla_channel) return model
def rla_mobilenetv2_eca(rla_channel=32, eca=True): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_eca......') model = RLA_MobileNetV2(rla_channel=rla_channel, ECA=eca) return model
def rla_mobilenetv2_k6(): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k6......') model = RLA_MobileNetV2(rla_channel=6) return model
def rla_mobilenetv2_k6_eca(eca=True): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k6_eca......') model = RLA_MobileNetV2(rla_channel=6, ECA=eca) return model
def rla_mobilenetv2_k12(): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k12......') model = RLA_MobileNetV2(rla_channel=12) return model
def rla_mobilenetv2_k12_eca(eca=True): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k12_eca......') model = RLA_MobileNetV2(rla_channel=12, ECA=eca) return model
def rla_mobilenetv2_k24(): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k24......') model = RLA_MobileNetV2(rla_channel=24) return model
def rla_mobilenetv2_k24_eca(eca=True): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k24_eca......') model = RLA_MobileNetV2(rla_channel=24, ECA=eca) return model
def rla_mobilenetv2_k32(): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k32......') model = RLA_MobileNetV2(rla_channel=32) return model
def rla_mobilenetv2_k32_eca(eca=True): ' Constructs a RLA_MobileNetV2 model.\n default: \n rla_channel = 32, ECA=False\n ' print('Constructing rla_mobilenetv2_k32_eca......') model = RLA_MobileNetV2(rla_channel=32, ECA=eca) return model
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(Bottleneck, self).__init__() if (norm_layer is None): norm_layer = nn.Batc...
class ResNet(nn.Module): def __init__(self, block, layers, num_classes=1000, SE=False, ECA=None, zero_init_last_bn=True, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None): super(ResNet, self).__init__() if (norm_layer is None): norm_layer = nn.BatchNorm...
def resnet50(): ' Constructs a ResNet-50 model.\n default: \n num_classes=1000, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing resnet50......') model = ResNet(Bottleneck, [3, 4, 6, 3]) return model
def resnet50_se(): ' Constructs a ResNet-50_SE model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnet50_se......') model = ResNet(Bottleneck, [3, 4, 6, 3], SE=True) return model
def resnet50_eca(k_size=[5, 5, 5, 7]): 'Constructs a ResNet-50_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n num_classes:The classes of classification\n pretrained (bool): If True, returns a model pre-trained on ImageNet\n ' print('Constructing resnet50_eca......'...
def resnet101(): ' Constructs a ResNet-101 model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnet101......') model = ResNet(Bottleneck, [3, 4, 23, 3]) return model
def resnet101_se(): ' Constructs a ResNet-101_SE model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnet101_se......') model = ResNet(Bottleneck, [3, 4, 23, 3], SE=True) return model
def resnet101_eca(k_size=[5, 5, 5, 7]): 'Constructs a ResNet-101_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n ' print('Constructing resnet101_eca......') model = ResNet(Bottleneck, [3, 4, 23, 3], ECA=k_size) return model
def resnet152(): ' Constructs a ResNet-152 model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnet152......') model = ResNet(Bottleneck, [3, 8, 36, 3]) return model
def resnet152_se(): ' Constructs a ResNet-152_SE model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnet152_se......') model = ResNet(Bottleneck, [3, 8, 36, 3], SE=True) return model
def resnet152_eca(k_size=[5, 5, 5, 7]): 'Constructs a ResNet-152_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n ' print('Constructing resnet152_eca......') model = ResNet(Bottleneck, [3, 8, 36, 3], ECA=k_size) return model
def resnext50_32x4d(): ' Constructs a ResNeXt50_32x4d model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnext50_32x4d......') model = ResNet(Bottleneck, [3, 4, 6, 3], groups=32, width_per_group=4) return model
def resnext50_32x4d_se(): ' Constructs a ResNeXt50_32x4d_SE model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnext50_32x4d_se......') model = ResNet(Bottleneck, [3, 4, 6, 3], SE=True, groups=32, width_per_group=4) return model
def resnext50_32x4d_eca(k_size=[5, 5, 5, 7]): 'Constructs a ResNeXt50_32x4d_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n ' print('Constructing resnext50_32x4d_eca......') model = ResNet(Bottleneck, [3, 4, 6, 3], ECA=k_size, groups=32, width_per_group=4) return model
def resnext101_32x4d(): ' Constructs a ResNeXt101_32x4d model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnext101_32x4d......') model = ResNet(Bottleneck, [3, 4, 23, 3], groups=32, width_per_group=4) return model
def resnext101_32x4d_se(): ' Constructs a ResNeXt101_32x4d_SE model.\n default: \n num_classes=1000, SE=False, ECA=None\n ' print('Constructing resnext101_32x4d_se......') model = ResNet(Bottleneck, [3, 4, 23, 3], SE=True, groups=32, width_per_group=4) return model
def resnext101_32x4d_eca(k_size=[5, 5, 5, 7]): 'Constructs a ResNeXt101_32x4d_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n ' print('Constructing resnext101_32x4d_eca......') model = ResNet(Bottleneck, [3, 4, 23, 3], ECA=k_size, groups=32, width_per_group=4) return mode...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(Bottleneck, self).__init__() if (norm_layer is None): norm_layer = nn.Batc...
class ResNet_k(nn.Module): def __init__(self, block, layers, num_classes=1000, SE=False, ECA=None, channel_k=32, zero_init_last_bn=True, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None): super(ResNet_k, self).__init__() if (norm_layer is None): norm_la...
def resnet50_k(channel_k=32): ' Constructs a ResNet-50 model.\n default: \n num_classes=1000, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing resnet50_k......') model = ResNet_k(Bottleneck, [3, 4, 6, 3], channel_k=channel_k) return model
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLA_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLA_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLA_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_init_l...
def rla_resnet50(rla_channel=32): ' Constructs a RLA_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rla_resnet50......') model = RLA_ResNet(RLA_Bottleneck, [3, 4, 6, 3]) return model
def rla_resnet50_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLA_ResNet-50_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rla_resnet50_eca......') model = RLA_R...
def rla_resnet101(rla_channel=32): ' Constructs a RLA_ResNet-101 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ' print('Constructing rla_resnet101......') model = RLA_ResNet(RLA_Bottleneck, [3, 4, 23, 3]) return model
def rla_resnet101_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLA_ResNet-101_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rla_resnet101_eca......') model = RL...
def rla_resnet152(rla_channel=32): ' Constructs a RLA_ResNet-152 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ' print('Constructing rla_resnet152......') model = RLA_ResNet(RLA_Bottleneck, [3, 8, 36, 3]) return model
def rla_resnet152_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLA_ResNet-101_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rla_resnet101_eca......') model = RL...
def rla_resnext50_32x4d(rla_channel=32): ' Constructs a RLA_ResNeXt50_32x4d model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ' print('Constructing rla_resnext50_32x4d......') model = RLA_ResNet(RLA_Bottleneck, [3, 4, 6, 3], groups=32, width_per_group=4) return m...
def rla_resnext50_32x4d_se(rla_channel=32): ' Constructs a RLA_ResNeXt50_32x4d_SE model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ' print('Constructing rla_resnext50_32x4d_se......') model = RLA_ResNet(RLA_Bottleneck, [3, 4, 6, 3], SE=True, groups=32, width_per_gro...
def rla_resnext50_32x4d_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLA_ResNeXt50_32x4d_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rla_resnext50_32x4d_eca.........
def rla_resnext101_32x4d(rla_channel=32): ' Constructs a RLA_ResNeXt101_32x4d model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ' print('Constructing rla_resnext101_32x4d......') model = RLA_ResNet(RLA_Bottleneck, [3, 4, 23, 3], groups=32, width_per_group=4) retu...
def rla_resnext101_32x4d_se(rla_channel=32): ' Constructs a RLA_ResNeXt101_32x4d_SE model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ' print('Constructing rla_resnext101_32x4d_se......') model = RLA_ResNet(RLA_Bottleneck, [3, 4, 23, 3], SE=True, groups=32, width_per...
def rla_resnext101_32x4d_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLA_ResNeXt101_32x4d_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rla_resnext101_32x4d_eca......
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLA_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLA_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLAgru_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_ini...
def rlagru_resnet50(rla_channel=32): ' Constructs a RLAgru_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlagru_resnet50......') model = RLAgru_ResNet(RLA_Bottleneck, [3, 4, 6, 3]) return...
def rlagru_resnet50_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLAgru_ResNet-50_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rlagru_resnet50_eca......') mode...
def rlagru_resnet101(rla_channel=32): ' Constructs a RLAgru_ResNet-101 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlagru_resnet101......') model = RLAgru_ResNet(RLA_Bottleneck, [3, 4, 23, 3]) re...
def rlagru_resnet101_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLAgru_ResNet-101_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rlagru_resnet101_eca......') m...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLA_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLA_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLAlstm_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_in...
def rlalstm_resnet50(rla_channel=32): ' Constructs a RLAlstm_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlalstm_resnet50......') model = RLAlstm_ResNet(RLA_Bottleneck, [3, 4, 6, 3]) re...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLArh_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLArh_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLArh_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_init...
def rlarh_resnet50(rla_channel=32): ' Constructs a RLArh_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlarh_resnet50......') model = RLArh_ResNet(RLArh_Bottleneck, [3, 4, 6, 3]) return m...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLAus_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLAus_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLAus_ResNet(nn.Module): def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_init_last_bn=True, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None): super(RLAus_ResNet, self).__init__() if (norm_layer is None): ...
def rlaus_resnet50(rla_channel=32): ' Constructs a RLAus_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlaus_resnet50......') model = RLAus_ResNet(RLAus_Bottleneck, [3, 4, 6, 3]) return m...
def rlaus_resnet101(rla_channel=32): ' Constructs a RLAus_ResNet-101 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlaus_resnet101......') model = RLAus_ResNet(RLAus_Bottleneck, [3, 4, 23, 3]) retu...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLAv1_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLAv1_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLAv1_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_init...
def rlav1_resnet50(rla_channel=32): ' Constructs a RLAv1_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlav1_resnet50......') model = RLAv1_ResNet(RLAv1_Bottleneck, [3, 4, 6, 3]) return m...
def rlav1_resnet50_eca(rla_channel=32, k_size=[5, 5, 5, 7]): 'Constructs a RLAv1_ResNet-50_ECA model.\n Args:\n k_size: Adaptive selection of kernel size\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n ' print('Constructing rlav1_resnet50_eca......') model =...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLAv1p_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLAv1p_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLAv1p_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_ini...
def rlav1p_resnet50(rla_channel=32): ' Constructs a RLAv1p_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlav1p_resnet50......') model = RLAv1p_ResNet(RLAv1p_Bottleneck, [3, 4, 6, 3]) ret...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLAv2_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLAv2_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLAv2_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_init...
def rlav2_resnet50(rla_channel=32): ' Constructs a RLAv2_ResNet-50 model.\n default: \n num_classes=1000, rla_channel=32, SE=False, ECA=None\n ECA: a list of kernel sizes in ECA\n ' print('Constructing rlav2_resnet50......') model = RLAv2_ResNet(RLAv2_Bottleneck, [3, 4, 6, 3]) return m...
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): '3x3 convolution with padding' return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_planes, out_planes, stride=1): '1x1 convolution' return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
class RLAv3_Bottleneck(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample=None, rla_channel=32, SE=False, ECA_size=None, groups=1, base_width=64, dilation=1, norm_layer=None, reduction=16): super(RLAv3_Bottleneck, self).__init__() if (norm_layer is None): ...
class RLAv3_ResNet(nn.Module): '\n rla_channel: the number of filters of the shared(recurrent) conv in RLA\n SE: whether use SE or not \n ECA: None: not use ECA, or specify a list of kernel sizes\n ' def __init__(self, block, layers, num_classes=1000, rla_channel=32, SE=False, ECA=None, zero_init...