class_docstr: ## DeepNorm Normalization
  
  $$x_{l + 1} = \mathop{LN}\Big( lpha x_l + \mathop{G}_l ig(x_l,    heta_l ig)\Big)$$
class_docstr_tok: ["#","#","DeepNorm","Normalization","$","$","x_","{","l","+","1","}","=","\\mathop","{","LN","}","\\Big","(","\u0007lpha","x_l","+","\\mathop","{","G","}","_l","\big","(","x_l",",","heta_l","\big",")","\\Big",")","$","$"]
docstr: :param alpha: is $lpha$
  :param normalized_shape: is the shape for LayerNorm $\mathop{LN}$
  :param eps: is $\epsilon$ for LayerNorm
  :param elementwise_affine: is a flag indicating whether to do an elementwise transformation in LayerNorm
docstr_tok: [":","param","alpha",":","is","$","\u0007lpha","$",":","param","normalized_shape",":","is","the","shape","for","LayerNorm","$","\\mathop","{","LN","}","$",":","param","eps",":","is","$","\\epsilon","$","for","LayerNorm",":","param","elementwise_affine",":","is","a","flag","indicating","whether","to","do","an","elementwise","transformation","in","LayerNorm"]
code: def __init__(
      self,
      alpha: float,
      normalized_shape: Union[int, List[int], Size],
      *,
      eps: float = 1e-5,
      elementwise_affine: bool = True,
  ):
      """
      :param alpha: is $\alpha$
      :param normalized_shape: is the shape for LayerNorm $\mathop{LN}$
      :param eps: is $\epsilon$ for LayerNorm
      :param elementwise_affine: is a flag indicating whether to do an elementwise transformation in LayerNorm
      """
      super().__init__()
  
      self.alpha = alpha
      # Initialize $\mathop{LN}$
      self.layer_norm = LayerNorm(
          normalized_shape,
          eps=eps,
          elementwise_affine=elementwise_affine,
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/normalization/deep_norm/__init__.py
imports: from typing import Union, List
  import torch
  from torch import nn, Size
  from labml_nn.normalization.layer_norm import LayerNorm
  from labml_nn.transformers import MultiHeadAttention
  from labml_nn.transformers.feed_forward import FeedForward
  from labml_nn.transformers.utils import subsequent_mask
label_desc: Use image node_id 1 to create a new DeepNorm object from inherited base classes: nn with example: obj = DeepNorm(alpha, normalized_shape)