class_docstr: Noisy dense layer that injects random noise to the weights of dense layer.
  
  Noisy dense layers are fully connected layers whose weights and biases are
  augmented by factorised Gaussian noise. The factorised Gaussian noise is
  controlled through gradient descent by a second weights layer.
  
  A `NoisyDense` layer implements the operation:
  $$
  \mathrm{NoisyDense}(x) =
  \mathrm{activation}(\mathrm{dot}(x, \mu + (\sigma \cdot \epsilon))
  + \mathrm{bias})
  $$
  where $\mu$ is the standard weights layer, $\epsilon$ is the factorised
  Gaussian noise, and $\sigma$ is a second weights layer which controls
  $\epsilon$.
  
  Note: bias only added if `use_bias` is `True`.
  
  Example:
  
  >>> # Create a `Sequential` model and add a NoisyDense
  >>> # layer as the first layer.
  >>> model = tf.keras.models.Sequential()
  >>> model.add(tf.keras.Input(shape=(16,)))
  >>> model.add(NoisyDense(32, activation='relu'))
  >>> # Now the model will take as input arrays of shape (None, 16)
  >>> # and output arrays of shape (None, 32).
  >>> # Note that after the first layer, you don't need to specify
  >>> # the size of the input anymore:
  >>> model.add(NoisyDense(32))
  >>> model.output_shape
  (None, 32)
  
  There are implemented both variants:
      1. Independent Gaussian noise
      2. Factorised Gaussian noise.
  We can choose between that by 'use_factorised' parameter.
  
  Args:
    units: Positive integer, dimensionality of the output space.
    sigma: A float between 0-1 used as a standard deviation figure and is
      applied to the gaussian noise layer (`sigma_kernel` and `sigma_bias`). (uses only if use_factorised=True)
    use_factorised: Boolean, whether the layer uses independent or factorised Gaussian noise
    activation: Activation function to use.
      If you don't specify anything, no activation is applied
      (ie. "linear" activation: `a(x) = x`).
    use_bias: Boolean, whether the layer uses a bias vector.
    kernel_regularizer: Regularizer function applied to
      the `kernel` weights matrix.
    bias_regularizer: Regularizer function applied to the bias vector.
    activity_regularizer: Regularizer function applied to
      the output of the layer (its "activation").
    kernel_constraint: Constraint function applied to
      the `kernel` weights matrix.
    bias_constraint: Constraint function applied to the bias vector.
  
  Input shape:
    N-D tensor with shape: `(batch_size, ..., input_dim)`.
    The most common situation would be
    a 2D input with shape `(batch_size, input_dim)`.
  
  Output shape:
    N-D tensor with shape: `(batch_size, ..., units)`.
    For instance, for a 2D input with shape `(batch_size, input_dim)`,
    the output would have shape `(batch_size, units)`.
  
  References:
    - [Noisy Networks for Explanation](https://arxiv.org/pdf/1706.10295.pdf)
class_docstr_tok: ["Noisy","dense","layer","that","injects","random","noise","to","the","weights","of","dense","layer",".","Noisy","dense","layers","are","fully","connected","layers","whose","weights","and","biases","are","augmented","by","factorised","Gaussian","noise",".","The","factorised","Gaussian","noise","is","controlled","through","gradient","descent","by","a","second","weights","layer",".","A","`","NoisyDense","`","layer","implements","the","operation",":","$","$","\\mathrm","{","NoisyDense","}","(","x",")","=","\\mathrm","{","activation","}","(","\\mathrm","{","dot","}","(","x",",","\\mu","+","(","\\sigma","\\cdot","\\epsilon",")",")","+","\\mathrm","{","bias","}",")","$","$","where","$","\\mu","$","is","the","standard","weights","layer",",","$","\\epsilon","$","is","the","factorised","Gaussian","noise",",","and","$","\\sigma","$","is","a","second","weights","layer","which","controls","$","\\epsilon","$",".","Note",":","bias","only","added","if","`","use_bias","`","is","`","True","`",".","Example",":",">",">",">","#","Create","a","`","Sequential","`","model","and","add","a","NoisyDense",">",">",">","#","layer","as","the","first","layer",".",">",">",">","model","=","tf.keras.models.Sequential","(",")",">",">",">","model.add","(","tf.keras.Input","(","shape=","(","16",",",")",")",")",">",">",">","model.add","(","NoisyDense","(","32",",","activation='relu","'",")",")",">",">",">","#","Now","the","model","will","take","as","input","arrays","of","shape","(","None",",","16",")",">",">",">","#","and","output","arrays","of","shape","(","None",",","32",")",".",">",">",">","#","Note","that","after","the","first","layer",",","you","do","n't","need","to","specify",">",">",">","#","the","size","of","the","input","anymore",":",">",">",">","model.add","(","NoisyDense","(","32",")",")",">",">",">","model.output_shape","(","None",",","32",")","There","are","implemented","both","variants",":","1",".","Independent","Gaussian","noise","2",".","Factorised","Gaussian","noise",".","We","can","choose","between","that","by","'use_factorised","'","parameter",".","Args",":","units",":","Positive","integer",",","dimensionality","of","the","output","space",".","sigma",":","A","float","between","0-1","used","as","a","standard","deviation","figure","and","is","applied","to","the","gaussian","noise","layer","(","`","sigma_kernel","`","and","`","sigma_bias","`",")",".","(","uses","only","if","use_factorised=True",")","use_factorised",":","Boolean",",","whether","the","layer","uses","independent","or","factorised","Gaussian","noise","activation",":","Activation","function","to","use",".","If","you","do","n't","specify","anything",",","no","activation","is","applied","(","ie",".","``","linear","''","activation",":","`","a","(","x",")","=","x","`",")",".","use_bias",":","Boolean",",","whether","the","layer","uses","a","bias","vector",".","kernel_regularizer",":","Regularizer","function","applied","to","the","`","kernel","`","weights","matrix",".","bias_regularizer",":","Regularizer","function","applied","to","the","bias","vector",".","activity_regularizer",":","Regularizer","function","applied","to","the","output","of","the","layer","(","its","``","activation","''",")",".","kernel_constraint",":","Constraint","function","applied","to","the","`","kernel","`","weights","matrix",".","bias_constraint",":","Constraint","function","applied","to","the","bias","vector",".","Input","shape",":","N-D","tensor","with","shape",":","`","(","batch_size",",","...",",","input_dim",")","`",".","The","most","common","situation","would","be","a","2D","input","with","shape","`","(","batch_size",",","input_dim",")","`",".","Output","shape",":","N-D","tensor","with","shape",":","`","(","batch_size",",","...",",","units",")","`",".","For","instance",",","for","a","2D","input","with","shape","`","(","batch_size",",","input_dim",")","`",",","the","output","would","have","shape","`","(","batch_size",",","units",")","`",".","References",":","-","[","Noisy","Networks","for","Explanation","]","(","https",":","\/\/arxiv.org\/pdf\/1706.10295.pdf",")"]
docstr: Remove the factorised Gaussian noise.
docstr_tok: ["Remove","the","factorised","Gaussian","noise","."]
code: def remove_noise(self):
      """Remove the factorised Gaussian noise."""
  
      self.eps_kernel.assign(
          tf.zeros([self.last_dim, self.units], dtype=self.dtype)
      )
      self.eps_bias.assign(tf.zeros([self.units], dtype=self.dtype))
  
file_path: addons/tensorflow_addons/layers/noisy_dense.py
imports: import tensorflow
  from tensorflow.keras import activations, initializers, regularizers, constraints
  from tensorflow.keras import backend
  from tensorflow.keras.layers import InputSpec
  from typeguard import typechecked
  from tensorflow_addons.utils import types
label_desc: Use image node_id 6 for calling the NoisyDense obj's underlying member method code with example usage: obj.remove_noise() without return types