class_docstr: Class for RNN performance generation models.
docstr: Generate a performance track from a primer performance track.
  
  Args:
    num_steps: The integer length in steps of the final track, after
        generation. Includes the primer.
    primer_sequence: The primer sequence, a Performance object.
    temperature: A float specifying how much to divide the logits by
       before computing the softmax. Greater than 1.0 makes tracks more
       random, less than 1.0 makes tracks less random.
    beam_size: An integer, beam size to use when generating tracks via
        beam search.
    branch_factor: An integer, beam search branch factor to use.
    steps_per_iteration: An integer, number of steps to take per beam search
        iteration.
    control_signal_fns: A list of functions that map time step to desired
        control value, or None if not using control signals.
    disable_conditioning_fn: A function that maps time step to whether or not
        conditioning should be disabled, or None if there is no conditioning
        or conditioning is not optional.
  
  Returns:
    The generated Performance object (which begins with the provided primer
    track).
docstr_tok: ["Generate","a","performance","track","from","a","primer","performance","track",".","Args",":","num_steps",":","The","integer","length","in","steps","of","the","final","track",",","after","generation",".","Includes","the","primer",".","primer_sequence",":","The","primer","sequence",",","a","Performance","object",".","temperature",":","A","float","specifying","how","much","to","divide","the","logits","by","before","computing","the","softmax",".","Greater","than","1.0","makes","tracks","more","random",",","less","than","1.0","makes","tracks","less","random",".","beam_size",":","An","integer",",","beam","size","to","use","when","generating","tracks","via","beam","search",".","branch_factor",":","An","integer",",","beam","search","branch","factor","to","use",".","steps_per_iteration",":","An","integer",",","number","of","steps","to","take","per","beam","search","iteration",".","control_signal_fns",":","A","list","of","functions","that","map","time","step","to","desired","control","value",",","or","None","if","not","using","control","signals",".","disable_conditioning_fn",":","A","function","that","maps","time","step","to","whether","or","not","conditioning","should","be","disabled",",","or","None","if","there","is","no","conditioning","or","conditioning","is","not","optional",".","Returns",":","The","generated","Performance","object","(","which","begins","with","the","provided","primer","track",")","."]
code: def generate_performance(
      self,
      num_steps,
      primer_sequence,
      temperature=1.0,
      beam_size=1,
      branch_factor=1,
      steps_per_iteration=1,
      control_signal_fns=None,
      disable_conditioning_fn=None,
  ):
      """Generate a performance track from a primer performance track.
  
      Args:
        num_steps: The integer length in steps of the final track, after
            generation. Includes the primer.
        primer_sequence: The primer sequence, a Performance object.
        temperature: A float specifying how much to divide the logits by
           before computing the softmax. Greater than 1.0 makes tracks more
           random, less than 1.0 makes tracks less random.
        beam_size: An integer, beam size to use when generating tracks via
            beam search.
        branch_factor: An integer, beam search branch factor to use.
        steps_per_iteration: An integer, number of steps to take per beam search
            iteration.
        control_signal_fns: A list of functions that map time step to desired
            control value, or None if not using control signals.
        disable_conditioning_fn: A function that maps time step to whether or not
            conditioning should be disabled, or None if there is no conditioning
            or conditioning is not optional.
  
      Returns:
        The generated Performance object (which begins with the provided primer
        track).
      """
      if control_signal_fns:
          control_event = tuple(f(0) for f in control_signal_fns)
          if disable_conditioning_fn is not None:
              control_event = (
                  disable_conditioning_fn(0),
                  control_event,
              )
          control_events = [control_event]
          control_state = PerformanceControlState(
              current_perf_index=0, current_perf_step=0
          )
          extend_control_events_callback = functools.partial(
              _extend_control_events,
              control_signal_fns,
              disable_conditioning_fn,
          )
      else:
          control_events = None
          control_state = None
          extend_control_events_callback = None
  
      return self._generate_events(
          num_steps,
          primer_sequence,
          temperature,
          beam_size,
          branch_factor,
          steps_per_iteration,
          control_events=control_events,
          control_state=control_state,
          extend_control_events_callback=extend_control_events_callback,
      )
  
file_path: magenta/magenta/models/performance_rnn/performance_model.py
imports: import collections
  import functools
  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 PerformanceRnnModel obj's underlying member method code with example usage: obj.generate_performance(num_steps, primer_sequence, temperature, beam_size, branch_factor, steps_per_iteration, control_signal_fns, disable_conditioning_fn) and returns: self