class_docstr: Estimate a reference channel by selecting the reference
  that maximizes the output SNR. It returns one-hot encoded
  vector or a soft reference.
  
  A straight-through estimator is used for gradient when using
  hard reference.
  
  Args:
      hard: If true, use hard estimate of ref channel.
          If false, use a soft estimate across channels.
      hard_use_grad: Use straight-through estimator for
          the gradient.
      subband_weighting: If true, use subband weighting when
          adding across subband SNRs. If false, use average
          across subbands.
  
  References:
      Boeddeker et al, Front-End Processing for the CHiME-5 Dinner Party Scenario, 2018
code: def __init__(
      self,
      hard: bool = True,
      hard_use_grad: bool = True,
      subband_weighting: bool = False,
      num_subbands: Optional[int] = None,
      eps: float = 1e-8,
  ):
      super().__init__()
  
      self.hard = hard
      self.hard_use_grad = hard_use_grad
      self.subband_weighting = subband_weighting
      self.eps = eps
  
      if subband_weighting and num_subbands is None:
          raise ValueError(
              f"Number of subbands must be provided when using subband_weighting={subband_weighting}."
          )
      # Subband weighting
      self.weight_s = (
          torch.nn.Parameter(torch.ones(num_subbands))
          if subband_weighting
          else None
      )
      self.weight_n = (
          torch.nn.Parameter(torch.ones(num_subbands))
          if subband_weighting
          else None
      )
  
      logging.debug("Initialized %s", self.__class__.__name__)
      logging.debug("\thard:              %d", self.hard)
      logging.debug("\thard_use_grad:     %d", self.hard_use_grad)
      logging.debug("\tsubband_weighting: %d", self.subband_weighting)
      logging.debug("\tnum_subbands:      %s", num_subbands)
      logging.debug("\teps:               %e", self.eps)
  
imports: import random
  from typing import Callable, Optional
  import torch
  from nemo.collections.asr.parts.submodules.multi_head_attention import MultiHeadAttention
  from nemo.core.classes import NeuralModule, typecheck
  from nemo.core.neural_types import AudioSignal, FloatType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new ReferenceChannelEstimatorSNR object from inherited base classes: NeuralModule with example: obj = ReferenceChannelEstimatorSNR(hard, hard_use_grad, subband_weighting, num_subbands, eps)