class_docstr: ResNet+FPN, output resolution are 1/8 and 1/2.
  
  Each block has 2 layers.
class_docstr_tok: ["ResNet+FPN",",","output","resolution","are","1\/8","and","1\/2",".","Each","block","has","2","layers","."]
code: def __init__(self, config: Dict[str, Any]) -> None:
      super().__init__()
      # Config
      block = BasicBlock
      initial_dim = config["initial_dim"]
      block_dims = config["block_dims"]
  
      # Class Variable
      self.in_planes = initial_dim
  
      # Networks
      self.conv1 = nn.Conv2d(
          1, initial_dim, kernel_size=7, stride=2, padding=3, bias=False
      )
      self.bn1 = nn.BatchNorm2d(initial_dim)
      self.relu = nn.ReLU(inplace=True)
  
      self.layer1 = self._make_layer(
          block, block_dims[0], stride=1
      )  # 1/2
      self.layer2 = self._make_layer(
          block, block_dims[1], stride=2
      )  # 1/4
      self.layer3 = self._make_layer(
          block, block_dims[2], stride=2
      )  # 1/8
  
      # 3. FPN upsample
      self.layer3_outconv = conv1x1(block_dims[2], block_dims[2])
      self.layer2_outconv = conv1x1(block_dims[1], block_dims[2])
      self.layer2_outconv2 = nn.Sequential(
          conv3x3(block_dims[2], block_dims[2]),
          nn.BatchNorm2d(block_dims[2]),
          nn.LeakyReLU(),
          conv3x3(block_dims[2], block_dims[1]),
      )
      self.layer1_outconv = conv1x1(block_dims[0], block_dims[1])
      self.layer1_outconv2 = nn.Sequential(
          conv3x3(block_dims[1], block_dims[1]),
          nn.BatchNorm2d(block_dims[1]),
          nn.LeakyReLU(),
          conv3x3(block_dims[1], block_dims[0]),
      )
  
      for m in self.modules():
          if isinstance(m, nn.Conv2d):
              nn.init.kaiming_normal_(
                  m.weight, mode="fan_out", nonlinearity="relu"
              )
          elif isinstance(m, (nn.BatchNorm2d, nn.GroupNorm)):
              nn.init.constant_(m.weight, 1)
              nn.init.constant_(m.bias, 0)
  
file_path: kornia/kornia/feature/loftr/backbone/resnet_fpn.py
imports: from typing import Any, Dict, List, Type, Union
  import torch.nn.functional
  from torch import nn
  from kornia.core import Module, Tensor
label_desc: Use image node_id 1 to create a new ResNetFPN_8_2 object from inherited base classes: nn with example: obj = ResNetFPN_8_2(config)