Skip to content

regnet

model.backbone.torchvision.regnet

__all__ module-attribute

__all__ = ['RegNet', 'regnet_y_400mf', 'regnet_y_800mf', 'regnet_y_1_6gf', 'regnet_y_3_2gf', 'regnet_y_8gf', 'regnet_y_16gf', 'regnet_y_32gf', 'regnet_y_128gf', 'regnet_x_400mf', 'regnet_x_800mf', 'regnet_x_1_6gf', 'regnet_x_3_2gf', 'regnet_x_8gf', 'regnet_x_16gf', 'regnet_x_32gf']

SimpleStemIN

SimpleStemIN(width_in: int, width_out: int, norm_layer: Callable[..., Module], activation_layer: Callable[..., Module])

Bases: Conv2dNormActivation

Simple stem for ImageNet: 3x3, BN, ReLU.

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def __init__(
    self,
    width_in: int,
    width_out: int,
    norm_layer: Callable[..., nn.Module],
    activation_layer: Callable[..., nn.Module],
) -> None:
    super().__init__(
        width_in,
        width_out,
        kernel_size=3,
        stride=2,
        norm_layer=norm_layer,
        activation_layer=activation_layer,
    )

BottleneckTransform

BottleneckTransform(width_in: int, width_out: int, stride: int, norm_layer: Callable[..., Module], activation_layer: Callable[..., Module], group_width: int, bottleneck_multiplier: float, se_ratio: Optional[float])

Bases: Sequential

Bottleneck transformation: 1x1, 3x3 [+SE], 1x1.

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def __init__(
    self,
    width_in: int,
    width_out: int,
    stride: int,
    norm_layer: Callable[..., nn.Module],
    activation_layer: Callable[..., nn.Module],
    group_width: int,
    bottleneck_multiplier: float,
    se_ratio: Optional[float],
) -> None:
    layers: OrderedDict[str, nn.Module] = OrderedDict()
    w_b = int(round(width_out * bottleneck_multiplier))
    g = w_b // group_width

    layers["a"] = Conv2dNormActivation(
        width_in,
        w_b,
        kernel_size=1,
        stride=1,
        norm_layer=norm_layer,
        activation_layer=activation_layer,
    )
    layers["b"] = Conv2dNormActivation(
        w_b,
        w_b,
        kernel_size=3,
        stride=stride,
        groups=g,
        norm_layer=norm_layer,
        activation_layer=activation_layer,
    )

    if se_ratio:
        # The SE reduction ratio is defined with respect to the
        # beginning of the block
        width_se_out = int(round(se_ratio * width_in))
        layers["se"] = SqueezeExcitation(
            input_channels=w_b,
            squeeze_channels=width_se_out,
            activation=activation_layer,
        )

    layers["c"] = Conv2dNormActivation(
        w_b, width_out, kernel_size=1, stride=1, norm_layer=norm_layer, activation_layer=None
    )
    super().__init__(layers)

ResBottleneckBlock

ResBottleneckBlock(width_in: int, width_out: int, stride: int, norm_layer: Callable[..., Module], activation_layer: Callable[..., Module], group_width: int = 1, bottleneck_multiplier: float = 1.0, se_ratio: Optional[float] = None)

Bases: Module

Residual bottleneck block: x + F(x), F = bottleneck transform.

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def __init__(
    self,
    width_in: int,
    width_out: int,
    stride: int,
    norm_layer: Callable[..., nn.Module],
    activation_layer: Callable[..., nn.Module],
    group_width: int = 1,
    bottleneck_multiplier: float = 1.0,
    se_ratio: Optional[float] = None,
) -> None:
    super().__init__()

    # Use skip connection with projection if shape changes
    self.proj = None
    should_proj = (width_in != width_out) or (stride != 1)
    if should_proj:
        self.proj = Conv2dNormActivation(
            width_in,
            width_out,
            kernel_size=1,
            stride=stride,
            norm_layer=norm_layer,
            activation_layer=None,
        )
    self.f = BottleneckTransform(
        width_in,
        width_out,
        stride,
        norm_layer,
        activation_layer,
        group_width,
        bottleneck_multiplier,
        se_ratio,
    )
    self.activation = activation_layer(inplace=True)

proj instance-attribute

proj = None

f instance-attribute

f = BottleneckTransform(width_in, width_out, stride, norm_layer, activation_layer, group_width, bottleneck_multiplier, se_ratio)

activation instance-attribute

activation = activation_layer(inplace=True)

forward

forward(x: Tensor) -> Tensor
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def forward(self, x: Tensor) -> Tensor:
    if self.proj is not None:
        x = self.proj(x) + self.f(x)
    else:
        x = x + self.f(x)
    return self.activation(x)

AnyStage

AnyStage(width_in: int, width_out: int, stride: int, depth: int, block_constructor: Callable[..., Module], norm_layer: Callable[..., Module], activation_layer: Callable[..., Module], group_width: int, bottleneck_multiplier: float, se_ratio: Optional[float] = None, stage_index: int = 0)

Bases: Sequential

AnyNet stage (sequence of blocks w/ the same output shape).

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def __init__(
    self,
    width_in: int,
    width_out: int,
    stride: int,
    depth: int,
    block_constructor: Callable[..., nn.Module],
    norm_layer: Callable[..., nn.Module],
    activation_layer: Callable[..., nn.Module],
    group_width: int,
    bottleneck_multiplier: float,
    se_ratio: Optional[float] = None,
    stage_index: int = 0,
) -> None:
    super().__init__()

    for i in range(depth):
        block = block_constructor(
            width_in if i == 0 else width_out,
            width_out,
            stride if i == 0 else 1,
            norm_layer,
            activation_layer,
            group_width,
            bottleneck_multiplier,
            se_ratio,
        )

        self.add_module(f"block{stage_index}-{i}", block)

BlockParams

BlockParams(depths: List[int], widths: List[int], group_widths: List[int], bottleneck_multipliers: List[float], strides: List[int], se_ratio: Optional[float] = None)
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def __init__(
    self,
    depths: List[int],
    widths: List[int],
    group_widths: List[int],
    bottleneck_multipliers: List[float],
    strides: List[int],
    se_ratio: Optional[float] = None,
) -> None:
    self.depths = depths
    self.widths = widths
    self.group_widths = group_widths
    self.bottleneck_multipliers = bottleneck_multipliers
    self.strides = strides
    self.se_ratio = se_ratio

depths instance-attribute

depths = depths

widths instance-attribute

widths = widths

group_widths instance-attribute

group_widths = group_widths

bottleneck_multipliers instance-attribute

bottleneck_multipliers = bottleneck_multipliers

strides instance-attribute

strides = strides

se_ratio instance-attribute

se_ratio = se_ratio

from_init_params classmethod

from_init_params(depth: int, w_0: int, w_a: float, w_m: float, group_width: int, bottleneck_multiplier: float = 1.0, se_ratio: Optional[float] = None, **kwargs: Any) -> BlockParams

Programmatically compute all the per-block settings, given the RegNet parameters. The first step is to compute the quantized linear block parameters, in log space. Key parameters are: - w_a is the width progression slope - w_0 is the initial width - w_m is the width stepping in the log space In other terms log(block_width) = log(w_0) + w_m * block_capacity, with bock_capacity ramping up following the w_0 and w_a params. This block width is finally quantized to multiples of 8. The second step is to compute the parameters per stage, taking into account the skip connection and the final 1x1 convolutions. We use the fact that the output width is constant within a stage.

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@classmethod
def from_init_params(
    cls,
    depth: int,
    w_0: int,
    w_a: float,
    w_m: float,
    group_width: int,
    bottleneck_multiplier: float = 1.0,
    se_ratio: Optional[float] = None,
    **kwargs: Any,
) -> "BlockParams":
    """
    Programmatically compute all the per-block settings,
    given the RegNet parameters.
    The first step is to compute the quantized linear block parameters,
    in log space. Key parameters are:
    - `w_a` is the width progression slope
    - `w_0` is the initial width
    - `w_m` is the width stepping in the log space
    In other terms
    `log(block_width) = log(w_0) + w_m * block_capacity`,
    with `bock_capacity` ramping up following the w_0 and w_a params.
    This block width is finally quantized to multiples of 8.
    The second step is to compute the parameters per stage,
    taking into account the skip connection and the final 1x1 convolutions.
    We use the fact that the output width is constant within a stage.
    """

    QUANT = 8
    STRIDE = 2

    if w_a < 0 or w_0 <= 0 or w_m <= 1 or w_0 % 8 != 0:
        raise ValueError("Invalid RegNet settings")
    # Compute the block widths. Each stage has one unique block width
    widths_cont = torch.arange(depth) * w_a + w_0
    block_capacity = torch.round(torch.log(widths_cont / w_0) / math.log(w_m))
    block_widths = (
        (torch.round(torch.divide(w_0 * torch.pow(w_m, block_capacity), QUANT)) * QUANT)
        .int()
        .tolist()
    )
    num_stages = len(set(block_widths))

    # Convert to per stage parameters
    split_helper = zip(
        block_widths + [0],
        [0] + block_widths,
        block_widths + [0],
        [0] + block_widths,
    )
    splits = [w != wp or r != rp for w, wp, r, rp in split_helper]

    stage_widths = [w for w, t in zip(block_widths, splits[:-1]) if t]
    stage_depths = torch.diff(torch.tensor([d for d, t in enumerate(splits) if t])).int().tolist()

    strides = [STRIDE] * num_stages
    bottleneck_multipliers = [bottleneck_multiplier] * num_stages
    group_widths = [group_width] * num_stages

    # Adjust the compatibility of stage widths and group widths
    stage_widths, group_widths = cls._adjust_widths_groups_compatibilty(
        stage_widths, bottleneck_multipliers, group_widths
    )

    return cls(
        depths=stage_depths,
        widths=stage_widths,
        group_widths=group_widths,
        bottleneck_multipliers=bottleneck_multipliers,
        strides=strides,
        se_ratio=se_ratio,
    )

_get_expanded_params

_get_expanded_params()
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def _get_expanded_params(self):
    return zip(
        self.widths, self.strides, self.depths, self.group_widths, self.bottleneck_multipliers
    )

_adjust_widths_groups_compatibilty staticmethod

_adjust_widths_groups_compatibilty(stage_widths: List[int], bottleneck_ratios: List[float], group_widths: List[int]) -> Tuple[List[int], List[int]]

Adjusts the compatibility of widths and groups, depending on the bottleneck ratio.

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@staticmethod
def _adjust_widths_groups_compatibilty(
    stage_widths: List[int], bottleneck_ratios: List[float], group_widths: List[int]
) -> Tuple[List[int], List[int]]:
    """
    Adjusts the compatibility of widths and groups,
    depending on the bottleneck ratio.
    """
    # Compute all widths for the current settings
    widths = [int(w * b) for w, b in zip(stage_widths, bottleneck_ratios)]
    group_widths_min = [min(g, w_bot) for g, w_bot in zip(group_widths, widths)]

    # Compute the adjusted widths so that stage and group widths fit
    ws_bot = [_make_divisible(w_bot, g) for w_bot, g in zip(widths, group_widths_min)]
    stage_widths = [int(w_bot / b) for w_bot, b in zip(ws_bot, bottleneck_ratios)]
    return stage_widths, group_widths_min

RegNet

RegNet(block_params: BlockParams, num_classes: int = 1000, stem_width: int = 32, stem_type: Optional[Callable[..., Module]] = None, block_type: Optional[Callable[..., Module]] = None, norm_layer: Optional[Callable[..., Module]] = None, activation: Optional[Callable[..., Module]] = None, in_channels: int = 3)

Bases: Module

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def __init__(
    self,
    block_params: BlockParams,
    num_classes: int = 1000,
    stem_width: int = 32,
    stem_type: Optional[Callable[..., nn.Module]] = None,
    block_type: Optional[Callable[..., nn.Module]] = None,
    norm_layer: Optional[Callable[..., nn.Module]] = None,
    activation: Optional[Callable[..., nn.Module]] = None,
    in_channels: int = 3,
) -> None:
    super().__init__()
    _log_api_usage_once(self)

    if stem_type is None:
        stem_type = SimpleStemIN
    if norm_layer is None:
        norm_layer = nn.BatchNorm2d
    if block_type is None:
        block_type = ResBottleneckBlock
    if activation is None:
        activation = nn.ReLU

    self.in_channels = in_channels

    # Ad hoc stem
    self.stem = stem_type(
        self.in_channels,  # width_in
        stem_width,
        norm_layer,
        activation,
    )

    current_width = stem_width

    blocks = []
    for i, (
        width_out,
        stride,
        depth,
        group_width,
        bottleneck_multiplier,
    ) in enumerate(block_params._get_expanded_params()):
        blocks.append(
            (
                f"block{i+1}",
                AnyStage(
                    current_width,
                    width_out,
                    stride,
                    depth,
                    block_type,
                    norm_layer,
                    activation,
                    group_width,
                    bottleneck_multiplier,
                    block_params.se_ratio,
                    stage_index=i + 1,
                ),
            )
        )

        current_width = width_out

    self.trunk_output = nn.Sequential(OrderedDict(blocks))

    # Performs ResNet-style weight initialization
    for m in self.modules():
        if isinstance(m, nn.Conv2d):
            # Note that there is no bias due to BN
            fan_out = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
            nn.init.normal_(m.weight, mean=0.0, std=math.sqrt(2.0 / fan_out))
        elif isinstance(m, nn.BatchNorm2d):
            nn.init.ones_(m.weight)
            nn.init.zeros_(m.bias)
        elif isinstance(m, nn.Linear):
            nn.init.normal_(m.weight, mean=0.0, std=0.01)
            nn.init.zeros_(m.bias)

in_channels instance-attribute

in_channels = in_channels

stem instance-attribute

stem = stem_type(in_channels, stem_width, norm_layer, activation)

trunk_output instance-attribute

trunk_output = Sequential(OrderedDict(blocks))

forward

forward(x: Tensor) -> Tensor
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def forward(self, x: Tensor) -> Tensor:
    x = self.stem(x)
    x = self.trunk_output(x)
    return x

load_state_dict

load_state_dict(state_dict, strict: bool = True)
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def load_state_dict(self, state_dict, strict: bool = True):
    extend_state_dict_input_channel(state_dict, "stem.0.weight", self.stem[0])
    for key in list(state_dict):
        if key.startswith("fc."):
            state_dict.pop(key)
    return super().load_state_dict(state_dict, strict)

extend_state_dict_input_channel

extend_state_dict_input_channel(state_dict: Mapping[str, Any], input_weight_key: str, input_conv_layer: Conv2d) -> None

(Multipage) 3채널 이상인 이미지를 사용하기 위해 필요한 기능이며, state_dict의 input conv 채널이 네트워크의 input conv 채널보다 작은 경우 해당 weight의 채널을 늘려줍니다. 현재 네트워크가 가진 input conv 웨이트에서 앞 3 채널을 state_dict의 input conv 웨이트로 치환하는 방식을 사용합니다.

Parameters:

  • state_dict (Mapping[str, Any]) –

    로드하려는 weight

  • input_weight_key (str) –

    input conv weight의 이름

  • input_conv_layer (Conv2d) –

    input conv layer

Source code in SaigeToolkit/model/util.py
def extend_state_dict_input_channel(
    state_dict: Mapping[str, Any],
    input_weight_key: str,
    input_conv_layer: nn.Conv2d,
) -> None:
    """(Multipage) 3채널 이상인 이미지를 사용하기 위해 필요한 기능이며,
    state_dict의 input conv 채널이 네트워크의 input conv 채널보다 작은 경우 해당 weight의 채널을 늘려줍니다.
    현재 네트워크가 가진 input conv 웨이트에서 앞 3 채널을 state_dict의 input conv 웨이트로 치환하는 방식을 사용합니다.

    Args:
        state_dict (Mapping[str, Any]): 로드하려는 weight
        input_weight_key (str): input conv weight의 이름
        input_conv_layer (nn.Conv2d): input conv layer
    """
    state_dict_in_channels = state_dict[input_weight_key].shape[1]
    if state_dict_in_channels != input_conv_layer.in_channels:
        state_dict_in_channels = min(state_dict_in_channels, input_conv_layer.in_channels)
        original_input_conv_weight = input_conv_layer.state_dict()["weight"]
        original_input_conv_weight[:, :state_dict_in_channels] = state_dict[input_weight_key][
            :, :state_dict_in_channels
        ]
        state_dict[input_weight_key] = original_input_conv_weight

_regnet

_regnet(block_params: BlockParams, weights: Optional[WeightsEnum], progress: bool, **kwargs: Any) -> RegNet
Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
def _regnet(
    block_params: BlockParams,
    weights: Optional[WeightsEnum],
    progress: bool,
    **kwargs: Any,
) -> RegNet:
    if weights is not None:
        _ovewrite_named_param(kwargs, "num_classes", len(weights.meta["categories"]))

    norm_layer = kwargs.pop("norm_layer", partial(nn.BatchNorm2d, eps=1e-05, momentum=0.1))
    model = RegNet(block_params, norm_layer=norm_layer, **kwargs)

    if weights is not None:
        model.load_state_dict(weights.get_state_dict(progress=progress))

    return model

regnet_y_400mf

regnet_y_400mf(*, weights: Optional[RegNet_Y_400MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_400MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_400MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_400MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_400MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_400MF_Weights.IMAGENET1K_V1))
def regnet_y_400mf(
    *, weights: Optional[RegNet_Y_400MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_400MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_400MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_400MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_400MF_Weights
        :members:
    """
    weights = RegNet_Y_400MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=16, w_0=48, w_a=27.89, w_m=2.09, group_width=8, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_800mf

regnet_y_800mf(*, weights: Optional[RegNet_Y_800MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_800MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_800MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_800MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_800MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_800MF_Weights.IMAGENET1K_V1))
def regnet_y_800mf(
    *, weights: Optional[RegNet_Y_800MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_800MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_800MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_800MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_800MF_Weights
        :members:
    """
    weights = RegNet_Y_800MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=14, w_0=56, w_a=38.84, w_m=2.4, group_width=16, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_1_6gf

regnet_y_1_6gf(*, weights: Optional[RegNet_Y_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_1.6GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_1_6GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_1_6GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_1_6GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_1_6GF_Weights.IMAGENET1K_V1))
def regnet_y_1_6gf(
    *, weights: Optional[RegNet_Y_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_1.6GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_1_6GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_1_6GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_1_6GF_Weights
        :members:
    """
    weights = RegNet_Y_1_6GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=27, w_0=48, w_a=20.71, w_m=2.65, group_width=24, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_3_2gf

regnet_y_3_2gf(*, weights: Optional[RegNet_Y_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_3.2GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_3_2GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_3_2GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_3_2GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_3_2GF_Weights.IMAGENET1K_V1))
def regnet_y_3_2gf(
    *, weights: Optional[RegNet_Y_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_3.2GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_3_2GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_3_2GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_3_2GF_Weights
        :members:
    """
    weights = RegNet_Y_3_2GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=21, w_0=80, w_a=42.63, w_m=2.66, group_width=24, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_8gf

regnet_y_8gf(*, weights: Optional[RegNet_Y_8GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_8GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_8GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_8GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_8GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_8GF_Weights.IMAGENET1K_V1))
def regnet_y_8gf(
    *, weights: Optional[RegNet_Y_8GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_8GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_8GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_8GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_8GF_Weights
        :members:
    """
    weights = RegNet_Y_8GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=17, w_0=192, w_a=76.82, w_m=2.19, group_width=56, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_16gf

regnet_y_16gf(*, weights: Optional[RegNet_Y_16GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_16GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_16GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_16GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_16GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_16GF_Weights.IMAGENET1K_V1))
def regnet_y_16gf(
    *, weights: Optional[RegNet_Y_16GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_16GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_16GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_16GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_16GF_Weights
        :members:
    """
    weights = RegNet_Y_16GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=18, w_0=200, w_a=106.23, w_m=2.48, group_width=112, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_32gf

regnet_y_32gf(*, weights: Optional[RegNet_Y_32GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_32GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_32GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_32GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_32GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_Y_32GF_Weights.IMAGENET1K_V1))
def regnet_y_32gf(
    *, weights: Optional[RegNet_Y_32GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_32GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_32GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_32GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_32GF_Weights
        :members:
    """
    weights = RegNet_Y_32GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=20, w_0=232, w_a=115.89, w_m=2.53, group_width=232, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_y_128gf

regnet_y_128gf(*, weights: Optional[RegNet_Y_128GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetY_128GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_Y_128GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_Y_128GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_Y_128GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", None))
def regnet_y_128gf(
    *, weights: Optional[RegNet_Y_128GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetY_128GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_Y_128GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_Y_128GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_Y_128GF_Weights
        :members:
    """
    weights = RegNet_Y_128GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=27, w_0=456, w_a=160.83, w_m=2.52, group_width=264, se_ratio=0.25, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_400mf

regnet_x_400mf(*, weights: Optional[RegNet_X_400MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_400MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_400MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_400MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_400MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_400MF_Weights.IMAGENET1K_V1))
def regnet_x_400mf(
    *, weights: Optional[RegNet_X_400MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_400MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_400MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_400MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_400MF_Weights
        :members:
    """
    weights = RegNet_X_400MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=22, w_0=24, w_a=24.48, w_m=2.54, group_width=16, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_800mf

regnet_x_800mf(*, weights: Optional[RegNet_X_800MF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_800MF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_800MF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_800MF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_800MF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_800MF_Weights.IMAGENET1K_V1))
def regnet_x_800mf(
    *, weights: Optional[RegNet_X_800MF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_800MF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_800MF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_800MF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_800MF_Weights
        :members:
    """
    weights = RegNet_X_800MF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=16, w_0=56, w_a=35.73, w_m=2.28, group_width=16, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_1_6gf

regnet_x_1_6gf(*, weights: Optional[RegNet_X_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_1.6GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_1_6GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_1_6GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_1_6GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_1_6GF_Weights.IMAGENET1K_V1))
def regnet_x_1_6gf(
    *, weights: Optional[RegNet_X_1_6GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_1.6GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_1_6GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_1_6GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_1_6GF_Weights
        :members:
    """
    weights = RegNet_X_1_6GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=18, w_0=80, w_a=34.01, w_m=2.25, group_width=24, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_3_2gf

regnet_x_3_2gf(*, weights: Optional[RegNet_X_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_3.2GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_3_2GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_3_2GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_3_2GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_3_2GF_Weights.IMAGENET1K_V1))
def regnet_x_3_2gf(
    *, weights: Optional[RegNet_X_3_2GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_3.2GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_3_2GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_3_2GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_3_2GF_Weights
        :members:
    """
    weights = RegNet_X_3_2GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=25, w_0=88, w_a=26.31, w_m=2.25, group_width=48, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_8gf

regnet_x_8gf(*, weights: Optional[RegNet_X_8GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_8GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_8GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_8GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_8GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_8GF_Weights.IMAGENET1K_V1))
def regnet_x_8gf(
    *, weights: Optional[RegNet_X_8GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_8GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_8GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_8GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_8GF_Weights
        :members:
    """
    weights = RegNet_X_8GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=23, w_0=80, w_a=49.56, w_m=2.88, group_width=120, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_16gf

regnet_x_16gf(*, weights: Optional[RegNet_X_16GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_16GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_16GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_16GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_16GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_16GF_Weights.IMAGENET1K_V1))
def regnet_x_16gf(
    *, weights: Optional[RegNet_X_16GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_16GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_16GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_16GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_16GF_Weights
        :members:
    """
    weights = RegNet_X_16GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=22, w_0=216, w_a=55.59, w_m=2.1, group_width=128, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)

regnet_x_32gf

regnet_x_32gf(*, weights: Optional[RegNet_X_32GF_Weights] = None, progress: bool = True, **kwargs: Any) -> RegNet

Constructs a RegNetX_32GF architecture from Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>. Args: weights (:class:~torchvision.models.RegNet_X_32GF_Weights, optional): The pretrained weights to use. See :class:~torchvision.models.RegNet_X_32GF_Weights below for more details and possible values. By default, no pretrained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. **kwargs: parameters passed to either torchvision.models.regnet.RegNet or torchvision.models.regnet.BlockParams class. Please refer to the source code <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py> for more detail about the classes. .. autoclass:: torchvision.models.RegNet_X_32GF_Weights :members:

Source code in SaigeToolkit/model/backbone/torchvision/regnet.py
@handle_legacy_interface(weights=("pretrained", RegNet_X_32GF_Weights.IMAGENET1K_V1))
def regnet_x_32gf(
    *, weights: Optional[RegNet_X_32GF_Weights] = None, progress: bool = True, **kwargs: Any
) -> RegNet:
    """
    Constructs a RegNetX_32GF architecture from
    `Designing Network Design Spaces <https://arxiv.org/abs/2003.13678>`_.
    Args:
        weights (:class:`~torchvision.models.RegNet_X_32GF_Weights`, optional): The pretrained weights to use.
            See :class:`~torchvision.models.RegNet_X_32GF_Weights` below for more details and possible values.
            By default, no pretrained weights are used.
        progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True.
        **kwargs: parameters passed to either ``torchvision.models.regnet.RegNet`` or
            ``torchvision.models.regnet.BlockParams`` class. Please refer to the `source code
            <https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py>`_
            for more detail about the classes.
    .. autoclass:: torchvision.models.RegNet_X_32GF_Weights
        :members:
    """
    weights = RegNet_X_32GF_Weights.verify(weights)

    params = BlockParams.from_init_params(
        depth=23, w_0=320, w_a=69.86, w_m=2.0, group_width=168, **kwargs
    )
    return _regnet(params, weights, progress, **kwargs)