class_docstr: One-Class Bottleneck Embedding module.
  
  Args:
      block (Bottleneck): Expansion value is extracted from this block.
      layers (int): Numbers of OCE layers to create after multiscale feature fusion.
      groups (int, optional): Number of blocked connections from input channels to output channels.
          Defaults to 1.
      width_per_group (int, optional): Number of layers in each intermediate convolution layer. Defaults to 64.
      norm_layer (Callable[..., nn.Module] | None, optional): Batch norm layer to use. Defaults to None.
class_docstr_tok: ["One-Class","Bottleneck","Embedding","module",".","Args",":","block","(","Bottleneck",")",":","Expansion","value","is","extracted","from","this","block",".","layers","(","int",")",":","Numbers","of","OCE","layers","to","create","after","multiscale","feature","fusion",".","groups","(","int",",","optional",")",":","Number","of","blocked","connections","from","input","channels","to","output","channels",".","Defaults","to","1.","width_per_group","(","int",",","optional",")",":","Number","of","layers","in","each","intermediate","convolution","layer",".","Defaults","to","64.","norm_layer","(","Callable","[","...",",","nn.Module","]","|","None",",","optional",")",":","Batch","norm","layer","to","use",".","Defaults","to","None","."]
code: def __init__(
      self,
      block: Bottleneck | BasicBlock,
      layers: int,
      groups: int = 1,
      width_per_group: int = 64,
      norm_layer: Callable[..., nn.Module] | None = None,
  ) -> None:
      super().__init__()
      if norm_layer is None:
          norm_layer = nn.BatchNorm2d
      self._norm_layer = norm_layer
      self.groups = groups
      self.base_width = width_per_group
      self.inplanes = 256 * block.expansion
      self.dilation = 1
      self.bn_layer = self._make_layer(block, 512, layers, stride=2)
  
      self.conv1 = conv3x3(
          64 * block.expansion, 128 * block.expansion, 2
      )
      self.bn1 = norm_layer(128 * block.expansion)
      self.relu = nn.ReLU(inplace=True)
      self.conv2 = conv3x3(
          128 * block.expansion, 256 * block.expansion, 2
      )
      self.bn2 = norm_layer(256 * block.expansion)
      self.conv3 = conv3x3(
          128 * block.expansion, 256 * block.expansion, 2
      )
      self.bn3 = norm_layer(256 * block.expansion)
  
      # self.conv4 and self.bn4 are from the original code:
      # https://github.com/hq-deng/RD4AD/blob/6554076872c65f8784f6ece8cfb39ce77e1aee12/resnet.py#L412
      self.conv4 = conv1x1(
          1024 * block.expansion, 512 * block.expansion, 1
      )
      self.bn4 = norm_layer(512 * block.expansion)
  
      for module in self.modules():
          if isinstance(module, nn.Conv2d):
              nn.init.kaiming_normal_(
                  module.weight, mode="fan_out", nonlinearity="relu"
              )
          elif isinstance(module, (nn.BatchNorm2d, nn.GroupNorm)):
              nn.init.constant_(module.weight, 1)
              nn.init.constant_(module.bias, 0)
  
file_path: anomalib/src/anomalib/models/reverse_distillation/components/bottleneck.py
imports: from __future__ import annotations
  from typing import Callable
  import torch
  from torch import Tensor, nn
  from torchvision.models.resnet import BasicBlock, Bottleneck
label_desc: Use image node_id 1 to create a new OCBE object from inherited base classes: nn with example: obj = OCBE(block, layers, groups, width_per_group, norm_layer)