:py:mod:`anomalib.models.reverse_distillation.components.bottleneck` ==================================================================== .. py:module:: anomalib.models.reverse_distillation.components.bottleneck .. autoapi-nested-parse:: Torch model defining the bottleneck layer. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anomalib.models.reverse_distillation.components.bottleneck.OCBE Functions ~~~~~~~~~ .. autoapisummary:: anomalib.models.reverse_distillation.components.bottleneck.conv3x3 anomalib.models.reverse_distillation.components.bottleneck.conv1x1 anomalib.models.reverse_distillation.components.bottleneck.get_bottleneck_layer .. py:function:: conv3x3(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1) -> torch.nn.Conv2d 3x3 convolution with padding. .. py:function:: conv1x1(in_planes: int, out_planes: int, stride: int = 1) -> torch.nn.Conv2d 1x1 convolution. .. py:class:: OCBE(block: Type[Union[torchvision.models.resnet.Bottleneck, torchvision.models.resnet.BasicBlock]], layers: int, groups: int = 1, width_per_group: int = 64, norm_layer: Optional[Callable[Ellipsis, torch.nn.Module]] = None) Bases: :py:obj:`torch.nn.Module` One-Class Bottleneck Embedding module. :param block: Expansion value is extracted from this block. :type block: Bottleneck :param layers: Numbers of OCE layers to create after multiscale feature fusion. :type layers: int :param groups: Number of blocked connections from input channels to output channels. Defaults to 1. :type groups: int, optional :param width_per_group: Number of layers in each intermediate convolution layer. Defaults to 64. :type width_per_group: int, optional :param norm_layer: Batch norm layer to use. Defaults to None. :type norm_layer: Optional[Callable[..., nn.Module]], optional .. py:method:: _make_layer(self, block: Type[Union[torchvision.models.resnet.Bottleneck, torchvision.models.resnet.BasicBlock]], planes: int, blocks: int, stride: int = 1, dilate: bool = False) -> torch.nn.Sequential .. py:method:: forward(self, features: List[torch.Tensor]) -> torch.Tensor Forward-pass of Bottleneck layer. :param features: List of features extracted from the encoder. :type features: List[Tensor] :returns: Output of the bottleneck layer :rtype: Tensor .. py:function:: get_bottleneck_layer(backbone: str, **kwargs) -> OCBE Get appropriate bottleneck layer based on the name of the backbone. :param backbone: Name of the backbone. :type backbone: str :returns: One-Class Bottleneck Embedding module. :rtype: Bottleneck_layer