class_docstr: Simplified Generalized Divisive Normalization (GDN).
  
  This applies the GDN layer, has been shown to be more useful for
  compression than other activation layers such as relu or tanh.
  Mathematically, it applies:
  
  .. math::
      z_i = \frac{x_i}{\beta_i + \sum_j \gamma_{ij}|x_j|}
  
  where :math:`\beta_i` and :math:`\gamma_{ij}` are trainable parameters.
  
  Johnston N, Eban E, Gordon A, Ballé J. Computationally efficient neural
  image compression. arXiv preprint arXiv:1912.08771. 2019 Dec 18.
  
  Args:
      channels: Number of channels in input.
      gamma_init: Initial value for ``gamma``.
      beta_min: Threshold for ``beta`` for numerical stability.
class_docstr_tok: ["Simplified","Generalized","Divisive","Normalization","(","GDN",")",".","This","applies","the","GDN","layer",",","has","been","shown","to","be","more","useful","for","compression","than","other","activation","layers","such","as","relu","or","tanh",".","Mathematically",",","it","applies",":","..","math",":",":","z_i","=","\\frac","{","x_i","}","{","\\beta_i","+","\\sum_j","\\gamma_","{","ij","}","|x_j|","}","where",":","math",":","`","\\beta_i","`","and",":","math",":","`","\\gamma_","{","ij","}","`","are","trainable","parameters",".","Johnston","N",",","Eban","E",",","Gordon","A",",","Ball\u00e9","J.","Computationally","efficient","neural","image","compression",".","arXiv","preprint","arXiv:1912.08771",".","2019","Dec","18",".","Args",":","channels",":","Number","of","channels","in","input",".","gamma_init",":","Initial","value","for","``","gamma","``",".","beta_min",":","Threshold","for","``","beta","``","for","numerical","stability","."]
code: def __init__(
      self,
      channels: int,
      gamma_init: float = 0.1,
      beta_min: float = 1e-6,
  ):
      super().__init__()
      self.gamma = nn.Parameter(
          torch.eye(channels).view(channels, channels, 1, 1)
          * gamma_init
      )
      self.beta = nn.Parameter(torch.ones(channels))
      self.beta_min = beta_min
  
file_path: NeuralCompression/neuralcompression/layers/_simplified_gdn.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
label_desc: Use image node_id 1 to create a new SimplifiedGDN object from inherited base classes: nn with example: obj = SimplifiedGDN(channels, gamma_init, beta_min)