class_docstr: Class for RNN melody generation models.
docstr: Generate a melody from a primer melody.
  
  Args:
    num_steps: The integer length in steps of the final melody, after
        generation. Includes the primer.
    primer_melody: The primer melody, a Melody object.
    temperature: A float specifying how much to divide the logits by
       before computing the softmax. Greater than 1.0 makes melodies more
       random, less than 1.0 makes melodies less random.
    beam_size: An integer, beam size to use when generating melodies via beam
        search.
    branch_factor: An integer, beam search branch factor to use.
    steps_per_iteration: An integer, number of melody steps to take per beam
        search iteration.
  
  Returns:
    The generated Melody object (which begins with the provided primer
        melody).
code: def generate_melody(
      self,
      num_steps,
      primer_melody,
      temperature=1.0,
      beam_size=1,
      branch_factor=1,
      steps_per_iteration=1,
  ):
      """Generate a melody from a primer melody.
  
      Args:
        num_steps: The integer length in steps of the final melody, after
            generation. Includes the primer.
        primer_melody: The primer melody, a Melody object.
        temperature: A float specifying how much to divide the logits by
           before computing the softmax. Greater than 1.0 makes melodies more
           random, less than 1.0 makes melodies less random.
        beam_size: An integer, beam size to use when generating melodies via beam
            search.
        branch_factor: An integer, beam search branch factor to use.
        steps_per_iteration: An integer, number of melody steps to take per beam
            search iteration.
  
      Returns:
        The generated Melody object (which begins with the provided primer
            melody).
      """
      melody = copy.deepcopy(primer_melody)
  
      transpose_amount = melody.squash(
          self._config.min_note,
          self._config.max_note,
          self._config.transpose_to_key,
      )
  
      melody = self._generate_events(
          num_steps,
          melody,
          temperature,
          beam_size,
          branch_factor,
          steps_per_iteration,
      )
  
      melody.transpose(-transpose_amount)
  
      return melody
  
file_path: magenta/magenta/models/melody_rnn/melody_rnn_model.py
imports: import copy
  from magenta.contrib import training
  from magenta.models.shared import events_rnn_model
  import note_seq
  from note_seq.protobuf import generator_pb2
label_desc: Use image node_id 1 for calling the MelodyRnnModel obj's underlying member method code with example usage: obj.generate_melody(num_steps, primer_melody, temperature, beam_size, branch_factor, steps_per_iteration) and returns: melody