class_docstr: Neural Autoregressive Distribution Estimator [1].
  
  [1]: https://arxiv.org/abs/1605.02226
  
  Args:
    num_dims: The number of binary dimensions for each observation.
    num_hidden: The number of hidden units in the NADE.
    internal_bias: Whether the model should maintain its own bias varaibles.
        Otherwise, external values must be passed to `log_prob` and `sample`.
class_docstr_tok: ["Neural","Autoregressive","Distribution","Estimator","[","1","]",".","[","1","]",":","https",":","\/\/arxiv.org\/abs\/1605.02226","Args",":","num_dims",":","The","number","of","binary","dimensions","for","each","observation",".","num_hidden",":","The","number","of","hidden","units","in","the","NADE",".","internal_bias",":","Whether","the","model","should","maintain","its","own","bias","varaibles",".","Otherwise",",","external","values","must","be","passed","to","`","log_prob","`","and","`","sample","`","."]
code: def __init__(
      self, num_dims, num_hidden, internal_bias=False, name="nade"
  ):
      self._num_dims = num_dims
      self._num_hidden = num_hidden
  
      std = 1.0 / math.sqrt(self._num_dims)
      initializer = tf.truncated_normal_initializer(stddev=std)
  
      with tf.variable_scope(name):
          # Encoder weights (`V` in [1]).
          self.w_enc = tf.get_variable(
              "w_enc",
              shape=[self._num_dims, 1, self._num_hidden],
              initializer=initializer,
          )
          # Transposed decoder weights (`W'` in [1]).
          self.w_dec_t = tf.get_variable(
              "w_dec_t",
              shape=[self._num_dims, self._num_hidden, 1],
              initializer=initializer,
          )
          # Internal encoder bias term (`b` in [1]). Will be used if external biases
          # are not provided.
          if internal_bias:
              self.b_enc = tf.get_variable(
                  "b_enc",
                  shape=[1, self._num_hidden],
                  initializer=initializer,
              )
          else:
              self.b_enc = None
          # Internal decoder bias term (`c` in [1]). Will be used if external biases
          # are not provided.
          if internal_bias:
              self.b_dec = tf.get_variable(
                  "b_dec",
                  shape=[1, self._num_dims],
                  initializer=initializer,
              )
          else:
              self.b_dec = None
  
file_path: magenta/magenta/common/nade.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import tensorflow.compat.v1
  import tensorflow_probability
label_desc: Use image node_id 1 to create a new Nade object from inherited base classes: object with example: obj = Nade(num_dims, num_hidden, internal_bias, name)