class_docstr: Builds graph for a Note RNN and instantiates weights from a checkpoint.
  
  Loads weights from a previously saved checkpoint file corresponding to a pre-
  trained basic_rnn model. Has functions that allow it to be primed with a MIDI
  melody, and allow it to be called to produce its predictions for the next
  note in a sequence.
  
  Used as part of the RLTuner class.
class_docstr_tok: ["Builds","graph","for","a","Note","RNN","and","instantiates","weights","from","a","checkpoint",".","Loads","weights","from","a","previously","saved","checkpoint","file","corresponding","to","a","pre-","trained","basic_rnn","model",".","Has","functions","that","allow","it","to","be","primed","with","a","MIDI","melody",",","and","allow","it","to","be","called","to","produce","its","predictions","for","the","next","note","in","a","sequence",".","Used","as","part","of","the","RLTuner","class","."]
docstr: Allows the network to be called, as in the following code snippet!
  
      q_network = MelodyRNN(...)
      q_network()
  
  The q_network() operation can then be placed into a larger graph as a tf op.
  
  Note that to get actual values from call, must do session.run and feed in
  melody_sequence, lengths, and initial_state in the feed dict.
  
  Returns:
    Either softmax probabilities over notes, or raw logit scores.
docstr_tok: ["Allows","the","network","to","be","called",",","as","in","the","following","code","snippet","!","q_network","=","MelodyRNN","(","...",")","q_network","(",")","The","q_network","(",")","operation","can","then","be","placed","into","a","larger","graph","as","a","tf","op",".","Note","that","to","get","actual","values","from","call",",","must","do","session.run","and","feed","in","melody_sequence",",","lengths",",","and","initial_state","in","the","feed","dict",".","Returns",":","Either","softmax","probabilities","over","notes",",","or","raw","logit","scores","."]
code: def __call__(self):
      """Allows the network to be called, as in the following code snippet!
  
          q_network = MelodyRNN(...)
          q_network()
  
      The q_network() operation can then be placed into a larger graph as a tf op.
  
      Note that to get actual values from call, must do session.run and feed in
      melody_sequence, lengths, and initial_state in the feed dict.
  
      Returns:
        Either softmax probabilities over notes, or raw logit scores.
      """
      with self.graph.as_default():
          with tf.variable_scope(self.scope, reuse=True):
              logits, self.state_tensor = self.run_network_on_melody(
                  self.melody_sequence, self.lengths, self.initial_state
              )
              return logits
  
imports: import os
  from magenta.common import sequence_example_lib
  from magenta.models.rl_tuner import rl_tuner_ops
  from magenta.models.shared import events_rnn_graph
  from magenta.pipelines import melody_pipelines
  import note_seq
  from note_seq import midi_io
  from note_seq import sequences_lib
  import numpy
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 12 for calling the NoteRNNLoader obj's underlying member method code with example usage: obj.__call__() and returns: logits