class_docstr: Module, which computes HyNet descriptors of given grayscale patches of 32x32.
  
  This is based on the original code from paper
  "HyNet: Learning Local Descriptor with Hybrid Similarity Measure and Triplet Loss".
  See :cite:`hynet2020` for more details.
  
  Args:
      pretrained: Download and set pretrained weights to the model.
      is_bias: use bias in TLU layers
      is_bias_FRN:  use bias in FRN layers
      dim_desc: descriptor dimensionality,
      drop_rate: dropout rate,
      eps_l2_norm: to avoid div by zero
  
  Returns:
      HyNet descriptor of the patches.
  
  Shape:
      - Input: :math:`(B, 1, 32, 32)`
      - Output: :math:`(B, 128)`
  
  Examples:
      >>> input = torch.rand(16, 1, 32, 32)
      >>> hynet = HyNet()
      >>> descs = hynet(input) # 16x128
class_docstr_tok: ["Module",",","which","computes","HyNet","descriptors","of","given","grayscale","patches","of","32x32",".","This","is","based","on","the","original","code","from","paper","''","HyNet",":","Learning","Local","Descriptor","with","Hybrid","Similarity","Measure","and","Triplet","Loss","''",".","See",":","cite",":","`","hynet2020","`","for","more","details",".","Args",":","pretrained",":","Download","and","set","pretrained","weights","to","the","model",".","is_bias",":","use","bias","in","TLU","layers","is_bias_FRN",":","use","bias","in","FRN","layers","dim_desc",":","descriptor","dimensionality",",","drop_rate",":","dropout","rate",",","eps_l2_norm",":","to","avoid","div","by","zero","Returns",":","HyNet","descriptor","of","the","patches",".","Shape",":","-","Input",":",":","math",":","`","(","B",",","1",",","32",",","32",")","`","-","Output",":",":","math",":","`","(","B",",","128",")","`","Examples",":",">",">",">","input","=","torch.rand","(","16",",","1",",","32",",","32",")",">",">",">","hynet","=","HyNet","(",")",">",">",">","descs","=","hynet","(","input",")","#","16x128"]
code: def __init__(
      self,
      pretrained: bool = False,
      is_bias: bool = True,
      is_bias_FRN: bool = True,
      dim_desc: int = 128,
      drop_rate: float = 0.3,
      eps_l2_norm: float = 1e-10,
  ) -> None:
      super().__init__()
      self.eps_l2_norm = eps_l2_norm
      self.dim_desc = dim_desc
      self.drop_rate = drop_rate
      self.layer1 = nn.Sequential(
          FilterResponseNorm2d(1, is_bias=is_bias_FRN),
          TLU(1),
          nn.Conv2d(1, 32, kernel_size=3, padding=1, bias=is_bias),
          FilterResponseNorm2d(32, is_bias=is_bias_FRN),
          TLU(32),
      )
  
      self.layer2 = nn.Sequential(
          nn.Conv2d(32, 32, kernel_size=3, padding=1, bias=is_bias),
          FilterResponseNorm2d(32, is_bias=is_bias_FRN),
          TLU(32),
      )
  
      self.layer3 = nn.Sequential(
          nn.Conv2d(
              32, 64, kernel_size=3, stride=2, padding=1, bias=is_bias
          ),
          FilterResponseNorm2d(64, is_bias=is_bias_FRN),
          TLU(64),
      )
  
      self.layer4 = nn.Sequential(
          nn.Conv2d(64, 64, kernel_size=3, padding=1, bias=is_bias),
          FilterResponseNorm2d(64, is_bias=is_bias_FRN),
          TLU(64),
      )
      self.layer5 = nn.Sequential(
          nn.Conv2d(
              64, 128, kernel_size=3, stride=2, padding=1, bias=is_bias
          ),
          FilterResponseNorm2d(128, is_bias=is_bias_FRN),
          TLU(128),
      )
  
      self.layer6 = nn.Sequential(
          nn.Conv2d(128, 128, kernel_size=3, padding=1, bias=is_bias),
          FilterResponseNorm2d(128, is_bias=is_bias_FRN),
          TLU(128),
      )
  
      self.layer7 = nn.Sequential(
          nn.Dropout(self.drop_rate),
          nn.Conv2d(128, self.dim_desc, kernel_size=8, bias=False),
          nn.BatchNorm2d(self.dim_desc, affine=False),
      )
  
      self.desc_norm = nn.LocalResponseNorm(
          2 * self.dim_desc, 2.0 * self.dim_desc, 0.5, 0.0
      )
      # use torch.hub to load pretrained model
      if pretrained:
          pretrained_dict = torch.hub.load_state_dict_from_url(
              urls["liberty"], map_location=map_location_to_cpu
          )
          self.load_state_dict(pretrained_dict, strict=True)
      self.eval()
  
imports: from typing import Dict
  import torch
  from torch import nn
  from kornia.core import Module, Parameter, Tensor, tensor, zeros
  from kornia.utils.helpers import map_location_to_cpu
label_desc: Use image node_id 1 to create a new HyNet object from inherited base classes: Module with example: obj = HyNet(pretrained, is_bias, is_bias_FRN, dim_desc, drop_rate, eps_l2_norm)