Skip to content

PyConvResNet

The PyConvResNet model is based on the "Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition" paper.

Architecture overview

This paper explores an alternative approach for convolutional block in a pyramidal fashion.

PyConvResNet architecture

The key takeaways from the paper are the following:

  • replaces standard convolutions with pyramidal convolutions
  • extends kernel size while increasing group size to balance the number of operations

Model builders

The following model builders can be used to instantiate a PyConvResNet model, with or without pre-trained weights. All the model builders internally rely on the ResNet base class.

pyconv_resnet50

pyconv_resnet50(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ResNet

PyConvResNet-50 from "Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition"

PARAMETER DESCRIPTION
pretrained

If True, returns a model pre-trained on ImageNet

TYPE: bool DEFAULT: False

progress

If True, displays a progress bar of the download to stderr

TYPE: bool DEFAULT: True

kwargs

keyword args of ResNet

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
ResNet

classification model

Source code in holocron/models/classification/pyconv_resnet.py
def pyconv_resnet50(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ResNet:
    """PyConvResNet-50 from ["Pyramidal Convolution: Rethinking Convolutional Neural Networks
    for Visual Recognition"](https://arxiv.org/pdf/2006.11538.pdf)

    Args:
        pretrained: If True, returns a model pre-trained on ImageNet
        progress: If True, displays a progress bar of the download to stderr
        kwargs: keyword args of [`ResNet`][holocron.models.classification.resnet.ResNet]

    Returns:
        classification model
    """
    return _pyconvresnet(
        "pyconv_resnet50",
        pretrained,
        progress,
        PyBottleneck,
        [3, 4, 6, 3],
        [64, 128, 256, 512],
        64,
        [[1, 4, 8, 16], [1, 4, 8], [1, 4], [1]],
        **kwargs,
    )

pyconvhg_resnet50

pyconvhg_resnet50(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ResNet

PyConvHGResNet-50 from "Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition"

PARAMETER DESCRIPTION
pretrained

If True, returns a model pre-trained on ImageNet

TYPE: bool DEFAULT: False

progress

If True, displays a progress bar of the download to stderr

TYPE: bool DEFAULT: True

kwargs

keyword args of ResNet

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
ResNet

classification model

Source code in holocron/models/classification/pyconv_resnet.py
def pyconvhg_resnet50(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ResNet:
    """PyConvHGResNet-50 from ["Pyramidal Convolution: Rethinking Convolutional Neural Networks
    for Visual Recognition"](https://arxiv.org/pdf/2006.11538.pdf)

    Args:
        pretrained: If True, returns a model pre-trained on ImageNet
        progress: If True, displays a progress bar of the download to stderr
        kwargs: keyword args of [`ResNet`][holocron.models.classification.resnet.ResNet]

    Returns:
        classification model
    """
    return _pyconvresnet(
        "pyconvhg_resnet50",
        pretrained,
        progress,
        PyHGBottleneck,
        [3, 4, 6, 3],
        [128, 256, 512, 1024],
        2,
        [[32, 32, 32, 32], [32, 64, 64], [32, 64], [32]],
        **kwargs,
    )