class_docstr: Mish activation definition.
  
  Mish(x) = x * tanh(softplus(x))
  
  Reference: https://arxiv.org/abs/1908.08681.
  
  Args:
      softplus_beta: Beta value for softplus activation formulation.
                       (Usually 0 > softplus_beta >= 2)
      softplus_threshold: Values above this revert to a linear function.
                       (Usually 10 > softplus_threshold >= 20)
      use_builtin: Whether to use PyTorch activation function if available.
class_docstr_tok: ["Mish","activation","definition",".","Mish","(","x",")","=","x","*","tanh","(","softplus","(","x",")",")","Reference",":","https",":","\/\/arxiv.org\/abs\/1908.08681",".","Args",":","softplus_beta",":","Beta","value","for","softplus","activation","formulation",".","(","Usually","0",">","softplus_beta",">","=","2",")","softplus_threshold",":","Values","above","this","revert","to","a","linear","function",".","(","Usually","10",">","softplus_threshold",">","=","20",")","use_builtin",":","Whether","to","use","PyTorch","activation","function","if","available","."]
code: def __init__(
      self,
      softplus_beta: float = 1.0,
      softplus_threshold: int = 20,
      use_builtin: bool = False,
  ) -> None:
      super().__init__()
  
      if use_builtin:
          self.mish = torch.nn.Mish()
      else:
          self.tanh = torch.nn.Tanh()
          self.softplus = torch.nn.Softplus(
              beta=softplus_beta, threshold=softplus_threshold
          )
  
          self.mish = lambda x: x * self.tanh(self.softplus(x))
  
file_path: espnet/espnet2/asr_transducer/activation.py
imports: import torch
  from packaging.version import parse
label_desc: Use image node_id 1 to create a new Mish object from inherited base classes: torch.nn with example: obj = Mish(softplus_beta, softplus_threshold, use_builtin)