class_docstr: Standardize inputs to zero mean and unit variance:
  
  .. math::
      y_i = \frac{x_i - \mu_i}{\sqrt{\sigma_i^2 + \epsilon}}
  
  The mean :math:`\mu_i` and variance :math:`\sigma_i^2` are computed and
  shared across a given set of axes. In contrast to batch normalization,
  these axes usually do not include the batch dimension, so each example is
  normalized independently from other examples in the minibatch, both during
  training and testing.
  
  The :class:`StandardizationLayer` can be employed to realize instance
  normalization [1]_ and layer normalization [2]_, for both of which
  convenience functions (:func:`instance_norm` and :func:`layer_norm`) are
  available.
  
  Parameters
  ----------
  incoming : a :class:`Layer` instance or a tuple
      The layer feeding into this layer, or the expected input shape
  axes : 'auto', 'spatial', 'features', int or tuple of int
      The axis or axes to normalize over. If ``'auto'`` (the default),
      two-dimensional inputs are normalized over the last dimension (i.e.,
      this will normalize over units for dense layers), input tensors with
      more than two dimensions are normalized over all but the first two
      dimensions (i.e., this will normalize over all spatial dimensions for
      convolutional layers). If ``'spatial'``, will normalize over all but
      the first two dimensions. If ``'features'``, will normalize over all
      but the first dimension.
  epsilon : scalar
      Small constant :math:`\epsilon` added to the variance before taking
      the square root and dividing by it, to avoid numerical problems
  **kwargs
      Any additional keyword arguments are passed to the :class:`Layer`
      superclass.
  
  See also
  --------
  instance_norm : Convenience function to apply instance normalization
  layer_norm : Convenience function to apply layer normalization to a layer
  
  References
  ----------
  .. [1] Ulyanov, D., Vedaldi, A., & Lempitsky, V. (2016):
         Instance Normalization: The Missing Ingredient for Fast Stylization.
         https://arxiv.org/abs/1607.08022.
  
  .. [2] Ba, J., Kiros, J., & Hinton, G. (2016):
         Layer normalization.
         https://arxiv.org/abs/1607.06450.
class_docstr_tok: ["Standardize","inputs","to","zero","mean","and","unit","variance",":","..","math",":",":","y_i","=","\\frac","{","x_i","-","\\mu_i","}","{","\\sqrt","{","\\sigma_i^2","+","\\epsilon","}","}","The","mean",":","math",":","`","\\mu_i","`","and","variance",":","math",":","`","\\sigma_i^2","`","are","computed","and","shared","across","a","given","set","of","axes",".","In","contrast","to","batch","normalization",",","these","axes","usually","do","not","include","the","batch","dimension",",","so","each","example","is","normalized","independently","from","other","examples","in","the","minibatch",",","both","during","training","and","testing",".","The",":","class",":","`","StandardizationLayer","`","can","be","employed","to","realize","instance","normalization","[","1","]","_","and","layer","normalization","[","2","]","_",",","for","both","of","which","convenience","functions","(",":","func",":","`","instance_norm","`","and",":","func",":","`","layer_norm","`",")","are","available",".","Parameters","--","--","--","--","--","incoming",":","a",":","class",":","`","Layer","`","instance","or","a","tuple","The","layer","feeding","into","this","layer",",","or","the","expected","input","shape","axes",":","'auto","'",",","'spatial","'",",","'features","'",",","int","or","tuple","of","int","The","axis","or","axes","to","normalize","over",".","If","``","'auto","'","``","(","the","default",")",",","two-dimensional","inputs","are","normalized","over","the","last","dimension","(","i.e.",",","this","will","normalize","over","units","for","dense","layers",")",",","input","tensors","with","more","than","two","dimensions","are","normalized","over","all","but","the","first","two","dimensions","(","i.e.",",","this","will","normalize","over","all","spatial","dimensions","for","convolutional","layers",")",".","If","``","'spatial","'","``",",","will","normalize","over","all","but","the","first","two","dimensions",".","If","``","'features","'","``",",","will","normalize","over","all","but","the","first","dimension",".","epsilon",":","scalar","Small","constant",":","math",":","`","\\epsilon","`","added","to","the","variance","before","taking","the","square","root","and","dividing","by","it",",","to","avoid","numerical","problems","*","*","kwargs","Any","additional","keyword","arguments","are","passed","to","the",":","class",":","`","Layer","`","superclass",".","See","also","--","--","--","--","instance_norm",":","Convenience","function","to","apply","instance","normalization","layer_norm",":","Convenience","function","to","apply","layer","normalization","to","a","layer","References","--","--","--","--","--","..","[","1","]","Ulyanov",",","D.",",","Vedaldi",",","A.",",","&","Lempitsky",",","V.","(","2016",")",":","Instance","Normalization",":","The","Missing","Ingredient","for","Fast","Stylization",".","https",":","\/\/arxiv.org\/abs\/1607.08022",".","..","[","2","]","Ba",",","J.",",","Kiros",",","J.",",","&","Hinton",",","G.","(","2016",")",":","Layer","normalization",".","https",":","\/\/arxiv.org\/abs\/1607.06450","."]
code: def __init__(self, incoming, axes="auto", epsilon=1e-4, **kwargs):
      super(StandardizationLayer, self).__init__(incoming, **kwargs)
  
      if axes == "auto":
          # default: normalize across 2nd dimension for 2D inputs
          # and across all but the first two axes for 3D+ inputs
          if len(self.input_shape) == 2:
              axes = (1,)
          else:
              axes = tuple(range(2, len(self.input_shape)))
      elif axes == "spatial":
          # normalize over spatial dimensions only,
          # separate for each instance in the batch
          axes = tuple(range(2, len(self.input_shape)))
      elif axes == "features":
          # normalize over features and spatial dimensions,
          # separate for each instance in the batch
          axes = tuple(range(1, len(self.input_shape)))
      elif isinstance(axes, int):
          axes = (axes,)
      self.axes = axes
  
      self.epsilon = epsilon
  
imports: import theano
  import theano.tensor
  from ..None import init
  from ..None import nonlinearities
  from ..utils import int_types
  from .base import Layer
label_desc: Use image node_id 1 to create a new StandardizationLayer object from inherited base classes: Layer with example: obj = StandardizationLayer(incoming, axes, epsilon)