class_docstr: Class for RNN-NADE sequence generation models.
docstr: Extends a batch of event sequences by a single step each.
  
  This method modifies the event sequences in place.
  
  Args:
    event_sequences: A list of PianorollSequences. The list of event
        sequences should have length equal to `self._batch_size()`.
    inputs: A Python list of model inputs, with length equal to
        `self._batch_size()`.
    initial_state: A numpy array containing the initial RNN-NADE state, where
        `initial_state.shape[0]` is equal to `self._batch_size()`.
    temperature: Unused.
  
  Returns:
    final_state: The final RNN-NADE state, the same size as `initial_state`.
    loglik: The log-likelihood of the sampled value for each event
        sequence, a 1-D numpy array of length
        `self._batch_size()`. If `inputs` is a full-length inputs batch, the
        log-likelihood of each entire sequence up to and including the
        generated step will be computed and returned.
docstr_tok: ["Extends","a","batch","of","event","sequences","by","a","single","step","each",".","This","method","modifies","the","event","sequences","in","place",".","Args",":","event_sequences",":","A","list","of","PianorollSequences",".","The","list","of","event","sequences","should","have","length","equal","to","`","self._batch_size","(",")","`",".","inputs",":","A","Python","list","of","model","inputs",",","with","length","equal","to","`","self._batch_size","(",")","`",".","initial_state",":","A","numpy","array","containing","the","initial","RNN-NADE","state",",","where","`","initial_state.shape","[","0","]","`","is","equal","to","`","self._batch_size","(",")","`",".","temperature",":","Unused",".","Returns",":","final_state",":","The","final","RNN-NADE","state",",","the","same","size","as","`","initial_state","`",".","loglik",":","The","log-likelihood","of","the","sampled","value","for","each","event","sequence",",","a","1-D","numpy","array","of","length","`","self._batch_size","(",")","`",".","If","`","inputs","`","is","a","full-length","inputs","batch",",","the","log-likelihood","of","each","entire","sequence","up","to","and","including","the","generated","step","will","be","computed","and","returned","."]
code: def _generate_step_for_batch(
      self, event_sequences, inputs, initial_state, temperature
  ):
      """Extends a batch of event sequences by a single step each.
  
      This method modifies the event sequences in place.
  
      Args:
        event_sequences: A list of PianorollSequences. The list of event
            sequences should have length equal to `self._batch_size()`.
        inputs: A Python list of model inputs, with length equal to
            `self._batch_size()`.
        initial_state: A numpy array containing the initial RNN-NADE state, where
            `initial_state.shape[0]` is equal to `self._batch_size()`.
        temperature: Unused.
  
      Returns:
        final_state: The final RNN-NADE state, the same size as `initial_state`.
        loglik: The log-likelihood of the sampled value for each event
            sequence, a 1-D numpy array of length
            `self._batch_size()`. If `inputs` is a full-length inputs batch, the
            log-likelihood of each entire sequence up to and including the
            generated step will be computed and returned.
      """
      pianoroll_sequences = event_sequences
      assert len(pianoroll_sequences) == self._batch_size()
  
      graph_inputs = self._session.graph.get_collection("inputs")[0]
      graph_initial_state = tuple(
          self._session.graph.get_collection("initial_state")
      )
      graph_final_state = tuple(
          self._session.graph.get_collection("final_state")
      )
      graph_sample = self._session.graph.get_collection("sample")[0]
      graph_log_prob = self._session.graph.get_collection("log_prob")[0]
  
      sample, loglik, final_state = self._session.run(
          [graph_sample, graph_log_prob, graph_final_state],
          {
              graph_inputs: inputs,
              graph_initial_state: initial_state,
          },
      )
  
      self._config.encoder_decoder.extend_event_sequences(
          pianoroll_sequences, sample
      )
  
      return final_state, loglik[:, 0]
  
file_path: magenta/magenta/models/pianoroll_rnn_nade/pianoroll_rnn_nade_model.py
imports: from magenta.contrib import training
  from magenta.models.pianoroll_rnn_nade import pianoroll_rnn_nade_graph
  from magenta.models.shared import events_rnn_model
  import note_seq
  from note_seq.protobuf import generator_pb2
label_desc: Use image node_id 2 for calling the PianorollRnnNadeModel obj's underlying member method code with example usage: obj._generate_step_for_batch(event_sequences, inputs, initial_state, temperature) and returns: final_state,  loglik