code: def __init__(self, config: Dict[str, Any]) -> None:
      super().__init__()
      self.config = config
      # general config
      self.thr = config["thr"]
      self.border_rm = config["border_rm"]
      # -- # for training fine-level LoFTR
      self.train_coarse_percent = config["train_coarse_percent"]
      self.train_pad_num_gt_min = config["train_pad_num_gt_min"]
  
      # we provide 2 options for differentiable matching
      self.match_type = config["match_type"]
      if self.match_type == "dual_softmax":
          self.temperature = config["dsmax_temperature"]
      elif self.match_type == "sinkhorn":
          try:
              from .superglue import log_optimal_transport
          except ImportError:
              raise ImportError("download superglue.py first!")
          self.log_optimal_transport = log_optimal_transport
          self.bin_score = nn.Parameter(
              torch.tensor(
                  config["skh_init_bin_score"], requires_grad=True
              )
          )
          self.skh_iters = config["skh_iters"]
          self.skh_prefilter = config["skh_prefilter"]
      else:
          raise NotImplementedError
  
file_path: kornia/kornia/feature/loftr/utils/coarse_matching.py
imports: from typing import Any, Dict, Optional, Union
  import torch
  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 CoarseMatching object from inherited base classes: Module with example: obj = CoarseMatching(config)