def __init__(self, axis=None, offset=True, scale=False,
               decay_rate=0.999, eps=1e-3, initializers=None,
               partitioners=None, regularizers=None,
               update_ops_collection="update_ops", fused=False,
               name="batch_norm"):
    """Constructs a BatchNorm module.

    By default reduces over all input tensor dimensions apart from the final
    dimension. This has the effect of treating pixels in 1D/2D/3D images as
    additional elements of the minibatch.

    If this is not the desired behaviour, the user can specify the tensor
    indices to reduce over with `axis`.

    Args:
      axis: Optional iterable of indices of dimensions to reduce over. By
        default `None` and all dimensions except the last are reduced over.
      offset: Optional boolean to specify whether or not to apply a trained
        component-wise bias after the batch normalization and scaling.
      scale: Optional boolean to specify whether or not to apply a trained
        component-wise scale after the batch normalization.
      decay_rate: Decay rate of the exponential moving averages of the mean
        and variance.
      eps: Small number to avoid dividing by zero when diving by the standard
        deviation.
      initializers: Optional dict containing ops to initialize the weights of
        the affine transform (`gamma` and `beta`).
      partitioners: Optional dict containing partitioners to partition the
        weights of the affine transform (`gamma` and `beta`).
      regularizers: Optional dict containing regularizers for the weights of the
        affine transform ('gamma' and 'beta'). As a default, no regularizers are
        used. A regularizer should be a function that takes a single `Tensor` as
        an input and returns a scalar `Tensor` output, e.g. the L1 and L2
        regularizers in `tf.contrib.layers`.
      update_ops_collection: Name of TensorFlow variable collection to add the
        moving average update ops to. If `None`, we instead add the update ops
        as control dependencies of the output of the module. This may result in
        some slowdown, as the feed-forward of the network is now blocked. By
        default, `tf.GraphKeys.UPDATE_OPS`.
      fused: Use nn.fused_batch_norm if True, nn.batch_normalization otherwise.
      name: Name of the module.

    Raises:
      KeyError: If `initializers` contains any keys other than `gamma`, `beta`,
        `moving_mean` or `moving_variance`.
      KeyError: If `partitioners` or `regularizers` contains any keys other
        than `gamma` or `beta`.
      TypeError: If any of the given initializers, partitioners or regularizers
        are not callable.
    """
    super(BatchNorm, self).__init__(name=name)

    self._axis = axis
    self._offset = offset
    self._scale = scale
    self._decay_rate = decay_rate
    self._eps = eps
    self._update_ops_collection = update_ops_collection
    self._fused = fused

    self._initializers = util.check_initializers(
        initializers, self.POSSIBLE_INITIALIZER_KEYS)
    self._partitioners = util.check_partitioners(
        partitioners, self.POSSIBLE_PARTITIONER_KEYS)
    self._regularizers = util.check_regularizers(
        regularizers, self.POSSIBLE_REGULARIZER_KEYS)
def __init__ ( self , axis = None , offset = True , scale = False , decay_rate = 0.999 , eps = 1e-3 , initializers = None , partitioners = None , regularizers = None , update_ops_collection = "update_ops" , fused = False , name = "batch_norm" ) : super ( BatchNorm , self ) . __init__ ( name = name ) self . _axis = axis self . _offset = offset self . _scale = scale self . _decay_rate = decay_rate self . _eps = eps self . _update_ops_collection = update_ops_collection self . _fused = fused self . _initializers = util . check_initializers ( initializers , self . POSSIBLE_INITIALIZER_KEYS ) self . _partitioners = util . check_partitioners ( partitioners , self . POSSIBLE_PARTITIONER_KEYS ) self . _regularizers = util . check_regularizers ( regularizers , self . POSSIBLE_REGULARIZER_KEYS )
Constructs a BatchNorm module.

    By default reduces over all input tensor dimensions apart from the final
    dimension. This has the effect of treating pixels in 1D/2D/3D images as
    additional elements of the minibatch.

    If this is not the desired behaviour, the user can specify the tensor
    indices to reduce over with `axis`.

    Args:
      axis: Optional iterable of indices of dimensions to reduce over. By
        default `None` and all dimensions except the last are reduced over.
      offset: Optional boolean to specify whether or not to apply a trained
        component-wise bias after the batch normalization and scaling.
      scale: Optional boolean to specify whether or not to apply a trained
        component-wise scale after the batch normalization.
      decay_rate: Decay rate of the exponential moving averages of the mean
        and variance.
      eps: Small number to avoid dividing by zero when diving by the standard
        deviation.
      initializers: Optional dict containing ops to initialize the weights of
        the affine transform (`gamma` and `beta`).
      partitioners: Optional dict containing partitioners to partition the
        weights of the affine transform (`gamma` and `beta`).
      regularizers: Optional dict containing regularizers for the weights of the
        affine transform ('gamma' and 'beta'). As a default, no regularizers are
        used. A regularizer should be a function that takes a single `Tensor` as
        an input and returns a scalar `Tensor` output, e.g. the L1 and L2
        regularizers in `tf.contrib.layers`.
      update_ops_collection: Name of TensorFlow variable collection to add the
        moving average update ops to. If `None`, we instead add the update ops
        as control dependencies of the output of the module. This may result in
        some slowdown, as the feed-forward of the network is now blocked. By
        default, `tf.GraphKeys.UPDATE_OPS`.
      fused: Use nn.fused_batch_norm if True, nn.batch_normalization otherwise.
      name: Name of the module.

    Raises:
      KeyError: If `initializers` contains any keys other than `gamma`, `beta`,
        `moving_mean` or `moving_variance`.
      KeyError: If `partitioners` or `regularizers` contains any keys other
        than `gamma` or `beta`.
      TypeError: If any of the given initializers, partitioners or regularizers
        are not callable.