class_docstr: RNN-NADE [2], a NADE parameterized by an RNN.
  
  The NADE's bias parameters are given by the output of the RNN.
  
  [2]: https://arxiv.org/abs/1206.6392
  
  Args:
    rnn_cell: The tf.nn.rnn_cell.RnnCell to use.
    num_dims: The number of binary dimensions for each observation.
    num_hidden: The number of hidden units in the NADE.
class_docstr_tok: ["RNN-NADE","[","2","]",",","a","NADE","parameterized","by","an","RNN",".","The","NADE","'s","bias","parameters","are","given","by","the","output","of","the","RNN",".","[","2","]",":","https",":","\/\/arxiv.org\/abs\/1206.6392","Args",":","rnn_cell",":","The","tf.nn.rnn_cell.RnnCell","to","use",".","num_dims",":","The","number","of","binary","dimensions","for","each","observation",".","num_hidden",":","The","number","of","hidden","units","in","the","NADE","."]
docstr: Computes the log probability of a sequence of values.
  
  Flattens the time dimension.
  
  Args:
    sequences: A batch of sequences to compute the log probabilities of,
        sized `[batch_size, max(lengths), num_dims]`.
    lengths: The length of each sequence, sized `[batch_size]` or None if
        all are equal.
  
  Returns:
    log_prob: The log probability of each sequence value, sized
        `[sum(lengths), 1]`.
    cond_prob: The conditional probabilities at each non-padded value for
        every batch, sized `[sum(lengths), num_dims]`.
docstr_tok: ["Computes","the","log","probability","of","a","sequence","of","values",".","Flattens","the","time","dimension",".","Args",":","sequences",":","A","batch","of","sequences","to","compute","the","log","probabilities","of",",","sized","`","[","batch_size",",","max","(","lengths",")",",","num_dims","]","`",".","lengths",":","The","length","of","each","sequence",",","sized","`","[","batch_size","]","`","or","None","if","all","are","equal",".","Returns",":","log_prob",":","The","log","probability","of","each","sequence","value",",","sized","`","[","sum","(","lengths",")",",","1","]","`",".","cond_prob",":","The","conditional","probabilities","at","each","non-padded","value","for","every","batch",",","sized","`","[","sum","(","lengths",")",",","num_dims","]","`","."]
code: def log_prob(self, sequences, lengths=None):
      """Computes the log probability of a sequence of values.
  
      Flattens the time dimension.
  
      Args:
        sequences: A batch of sequences to compute the log probabilities of,
            sized `[batch_size, max(lengths), num_dims]`.
        lengths: The length of each sequence, sized `[batch_size]` or None if
            all are equal.
  
      Returns:
        log_prob: The log probability of each sequence value, sized
            `[sum(lengths), 1]`.
        cond_prob: The conditional probabilities at each non-padded value for
            every batch, sized `[sum(lengths), num_dims]`.
      """
      assert self._num_dims == int(sequences.shape[2])
  
      # Remove last value from input sequences.
      inputs = sequences[:, 0:-1, :]
  
      # Add initial padding value to input sequences.
      inputs = tf.pad(inputs, [[0, 0], [1, 0], [0, 0]])
  
      state = self._get_state(inputs, lengths=lengths)
  
      # Flatten time dimension.
      labels_flat = magenta.common.flatten_maybe_padded_sequences(
          sequences, lengths
      )
  
      return self._nade.log_prob(labels_flat, state.b_enc, state.b_dec)
  
file_path: magenta/magenta/models/pianoroll_rnn_nade/pianoroll_rnn_nade_graph.py
imports: import collections
  import magenta
  from magenta.common import Nade
  from magenta.contrib import seq2seq
  from magenta.models.shared import events_rnn_graph
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 4 for calling the RnnNade obj's underlying member method code with example usage: obj.log_prob(sequences, lengths) and returns: self