class_docstr: lasagne.layers.BatchNormDNNLayer(incoming, axes='auto', epsilon=1e-4,
  alpha=0.1, beta=lasagne.init.Constant(0), gamma=lasagne.init.Constant(1),
  mean=lasagne.init.Constant(0), inv_std=lasagne.init.Constant(1), **kwargs)
  
  Batch Normalization
  
  This layer implements batch normalization of its inputs:
  
  .. math::
      y = \frac{x - \mu}{\sqrt{\sigma^2 + \epsilon}} \gamma + \beta
  
  This is a drop-in replacement for :class:`lasagne.layers.BatchNormLayer`
  that uses cuDNN for improved performance and reduced memory usage.
  
  Parameters
  ----------
  incoming : a :class:`Layer` instance or a tuple
      The layer feeding into this layer, or the expected input shape
  axes : 'auto', int or tuple of int
      The axis or axes to normalize over. If ``'auto'`` (the default),
      normalize over all axes except for the second: this will normalize over
      the minibatch dimension for dense layers, and additionally over all
      spatial dimensions for convolutional layers. Only supports ``'auto'``
      and the equivalent axes list, or ``0`` and ``(0,)`` to normalize over
      the minibatch dimension only.
  epsilon : scalar
      Small constant :math:`\epsilon` added to the variance before taking
      the square root and dividing by it, to avoid numerical problems. Must
      not be smaller than ``1e-5``.
  alpha : scalar
      Coefficient for the exponential moving average of batch-wise means and
      standard deviations computed during training; the closer to one, the
      more it will depend on the last batches seen
  beta : Theano shared variable, expression, numpy array, callable or None
      Initial value, expression or initializer for :math:`\beta`. Must match
      the incoming shape, skipping all axes in `axes`. Set to ``None`` to fix
      it to 0.0 instead of learning it.
      See :func:`lasagne.utils.create_param` for more information.
  gamma : Theano shared variable, expression, numpy array, callable or None
      Initial value, expression or initializer for :math:`\gamma`. Must
      match the incoming shape, skipping all axes in `axes`. Set to ``None``
      to fix it to 1.0 instead of learning it.
      See :func:`lasagne.utils.create_param` for more information.
  mean : Theano shared variable, expression, numpy array, or callable
      Initial value, expression or initializer for :math:`\mu`. Must match
      the incoming shape, skipping all axes in `axes`.
      See :func:`lasagne.utils.create_param` for more information.
  inv_std : Theano shared variable, expression, numpy array, or callable
      Initial value, expression or initializer for :math:`1 / \sqrt{
      \sigma^2 + \epsilon}`. Must match the incoming shape, skipping all
      axes in `axes`.
      See :func:`lasagne.utils.create_param` for more information.
  **kwargs
      Any additional keyword arguments are passed to the :class:`Layer`
      superclass.
  
  Notes
  -----
  This layer should be inserted between a linear transformation (such as a
  :class:`DenseLayer`, or :class:`Conv2DLayer`) and its nonlinearity. The
  convenience function :func:`batch_norm_dnn` modifies an existing layer to
  insert cuDNN batch normalization in front of its nonlinearity.
  
  For further information, see :class:`lasagne.layers.BatchNormLayer`. This
  implementation is fully compatible, except for restrictions on the `axes`
  and `epsilon` arguments.
  
  See also
  --------
  batch_norm_dnn : Convenience function to apply batch normalization
class_docstr_tok: ["lasagne.layers.BatchNormDNNLayer","(","incoming",",","axes='auto","'",",","epsilon=1e-4",",","alpha=0.1",",","beta=lasagne.init.Constant","(","0",")",",","gamma=lasagne.init.Constant","(","1",")",",","mean=lasagne.init.Constant","(","0",")",",","inv_std=lasagne.init.Constant","(","1",")",",","*","*","kwargs",")","Batch","Normalization","This","layer","implements","batch","normalization","of","its","inputs",":","..","math",":",":","y","=","\\frac","{","x","-","\\mu","}","{","\\sqrt","{","\\sigma^2","+","\\epsilon","}","}","\\gamma","+","\\beta","This","is","a","drop-in","replacement","for",":","class",":","`","lasagne.layers.BatchNormLayer","`","that","uses","cuDNN","for","improved","performance","and","reduced","memory","usage",".","Parameters","--","--","--","--","--","incoming",":","a",":","class",":","`","Layer","`","instance","or","a","tuple","The","layer","feeding","into","this","layer",",","or","the","expected","input","shape","axes",":","'auto","'",",","int","or","tuple","of","int","The","axis","or","axes","to","normalize","over",".","If","``","'auto","'","``","(","the","default",")",",","normalize","over","all","axes","except","for","the","second",":","this","will","normalize","over","the","minibatch","dimension","for","dense","layers",",","and","additionally","over","all","spatial","dimensions","for","convolutional","layers",".","Only","supports","``","'auto","'","``","and","the","equivalent","axes","list",",","or","``","0","``","and","``","(","0",",",")","``","to","normalize","over","the","minibatch","dimension","only",".","epsilon",":","scalar","Small","constant",":","math",":","`","\\epsilon","`","added","to","the","variance","before","taking","the","square","root","and","dividing","by","it",",","to","avoid","numerical","problems",".","Must","not","be","smaller","than","``","1e-5","``",".","alpha",":","scalar","Coefficient","for","the","exponential","moving","average","of","batch-wise","means","and","standard","deviations","computed","during","training",";","the","closer","to","one",",","the","more","it","will","depend","on","the","last","batches","seen","beta",":","Theano","shared","variable",",","expression",",","numpy","array",",","callable","or","None","Initial","value",",","expression","or","initializer","for",":","math",":","`","\\beta","`",".","Must","match","the","incoming","shape",",","skipping","all","axes","in","`","axes","`",".","Set","to","``","None","``","to","fix","it","to","0.0","instead","of","learning","it",".","See",":","func",":","`","lasagne.utils.create_param","`","for","more","information",".","gamma",":","Theano","shared","variable",",","expression",",","numpy","array",",","callable","or","None","Initial","value",",","expression","or","initializer","for",":","math",":","`","\\gamma","`",".","Must","match","the","incoming","shape",",","skipping","all","axes","in","`","axes","`",".","Set","to","``","None","``","to","fix","it","to","1.0","instead","of","learning","it",".","See",":","func",":","`","lasagne.utils.create_param","`","for","more","information",".","mean",":","Theano","shared","variable",",","expression",",","numpy","array",",","or","callable","Initial","value",",","expression","or","initializer","for",":","math",":","`","\\mu","`",".","Must","match","the","incoming","shape",",","skipping","all","axes","in","`","axes","`",".","See",":","func",":","`","lasagne.utils.create_param","`","for","more","information",".","inv_std",":","Theano","shared","variable",",","expression",",","numpy","array",",","or","callable","Initial","value",",","expression","or","initializer","for",":","math",":","`","1","\/","\\sqrt","{","\\sigma^2","+","\\epsilon","}","`",".","Must","match","the","incoming","shape",",","skipping","all","axes","in","`","axes","`",".","See",":","func",":","`","lasagne.utils.create_param","`","for","more","information",".","*","*","kwargs","Any","additional","keyword","arguments","are","passed","to","the",":","class",":","`","Layer","`","superclass",".","Notes","--","--","-","This","layer","should","be","inserted","between","a","linear","transformation","(","such","as","a",":","class",":","`","DenseLayer","`",",","or",":","class",":","`","Conv2DLayer","`",")","and","its","nonlinearity",".","The","convenience","function",":","func",":","`","batch_norm_dnn","`","modifies","an","existing","layer","to","insert","cuDNN","batch","normalization","in","front","of","its","nonlinearity",".","For","further","information",",","see",":","class",":","`","lasagne.layers.BatchNormLayer","`",".","This","implementation","is","fully","compatible",",","except","for","restrictions","on","the","`","axes","`","and","`","epsilon","`","arguments",".","See","also","--","--","--","--","batch_norm_dnn",":","Convenience","function","to","apply","batch","normalization"]
code: def __init__(
      self,
      incoming,
      axes="auto",
      epsilon=1e-4,
      alpha=0.1,
      beta=init.Constant(0),
      gamma=init.Constant(1),
      mean=init.Constant(0),
      inv_std=init.Constant(1),
      **kwargs,
  ):
      super(BatchNormDNNLayer, self).__init__(
          incoming,
          axes,
          epsilon,
          alpha,
          beta,
          gamma,
          mean,
          inv_std,
          **kwargs,
      )
      all_but_second_axis = (0,) + tuple(
          range(2, len(self.input_shape))
      )
      if self.axes not in ((0,), all_but_second_axis):
          raise ValueError(
              "BatchNormDNNLayer only supports normalization "
              "across the first axis, or across all but the "
              "second axis, got axes=%r" % (axes,)
          )
  
imports: import warnings
  import theano
  from ..None import init
  from ..None import nonlinearities
  from .base import Layer
  from .conv import conv_output_length, BaseConvLayer
  from .pool import pool_output_length
  from .normalization import BatchNormLayer
  from ..utils import as_tuple
label_desc: Use image node_id 1 to create a new BatchNormDNNLayer object from inherited base classes: BatchNormLayer with example: obj = BatchNormDNNLayer(incoming, axes, epsilon, alpha, beta, gamma, mean, inv_std)