code: def __init__(
      self,
      in_features: int,
      out_features: int,  # num_classes
      zs_weight_path: str,
      zs_weight_dim: int = 512,
      use_bias: float = 0.0,
      norm_weight: bool = True,
      norm_temperature: float = 50.0,
  ):
      super().__init__()
      num_classes = out_features
      self.norm_weight = norm_weight
      self.norm_temperature = norm_temperature
  
      self.use_bias = use_bias < 0
      if self.use_bias:
          self.cls_bias = nn.Parameter(torch.ones(1) * use_bias)
  
      self.linear = nn.Linear(in_features, zs_weight_dim)
  
      if zs_weight_path == "rand":
          zs_weight = torch.randn((zs_weight_dim, num_classes))
          nn.init.normal_(zs_weight, std=0.01)
      else:
          zs_weight = (
              torch.tensor(np.load(zs_weight_path), dtype=torch.float32)
              .permute(1, 0)
              .contiguous()
          )  # D x C
      zs_weight = torch.cat(
          [zs_weight, zs_weight.new_zeros((zs_weight_dim, 1))], dim=1
      )  # D x (C + 1)
  
      if self.norm_weight:
          zs_weight = F.normalize(zs_weight, p=2, dim=0)
  
      if zs_weight_path == "rand":
          self.zs_weight = nn.Parameter(zs_weight)
      else:
          self.register_buffer("zs_weight", zs_weight)
  
      assert (
          self.zs_weight.shape[1] == num_classes + 1
      ), self.zs_weight.shape
  
file_path: mmdetection/projects/Detic_new/detic/zero_shot_classifier.py
imports: import numpy
  import torch
  from torch import nn
  from torch.nn import functional
  from mmdet.registry import MODELS
label_desc: Use image node_id 1 to create a new ZeroShotClassifier object from inherited base classes: nn with example: obj = ZeroShotClassifier(in_features, out_features, zs_weight_path, zs_weight_dim, use_bias, norm_weight, norm_temperature)