class_docstr: Stores a configuration for an ImprovRnn.
  
  You can change `min_note` and `max_note` to increase/decrease the melody
  range. Since melodies are transposed into this range to be run through
  the model and then transposed back into their original range after the
  melodies have been extended, the location of the range is somewhat
  arbitrary, but the size of the range determines the possible size of the
  generated melodies range. `transpose_to_key` should be set to the key
  that if melodies were transposed into that key, they would best sit
  between `min_note` and `max_note` with having as few notes outside that
  range. If `transpose_to_key` is None, melodies and chords will not be
  transposed at generation time, but all of the training data will be transposed
  into all 12 keys.
  
  Attributes:
    details: The GeneratorDetails message describing the config.
    encoder_decoder: The EventSequenceEncoderDecoder object to use.
    hparams: The HParams containing hyperparameters to use.
    min_note: The minimum midi pitch the encoded melodies can have.
    max_note: The maximum midi pitch (exclusive) the encoded melodies can have.
    transpose_to_key: The key that encoded melodies and chords will be
        transposed into, or None if they should not be transposed. If None, all
        of the training data will be transposed into all 12 keys.
code: def __init__(
      self,
      details,
      encoder_decoder,
      hparams,
      min_note=DEFAULT_MIN_NOTE,
      max_note=DEFAULT_MAX_NOTE,
      transpose_to_key=DEFAULT_TRANSPOSE_TO_KEY,
  ):
      super(ImprovRnnConfig, self).__init__(
          details, encoder_decoder, hparams
      )
  
      if min_note < note_seq.MIN_MIDI_PITCH:
          raise ValueError(
              "min_note must be >= 0. min_note is %d." % min_note
          )
      if max_note > note_seq.MAX_MIDI_PITCH + 1:
          raise ValueError(
              "max_note must be <= 128. max_note is %d." % max_note
          )
      if max_note - min_note < note_seq.NOTES_PER_OCTAVE:
          raise ValueError(
              "max_note - min_note must be >= 12. min_note is %d. "
              "max_note is %d. max_note - min_note is %d."
              % (min_note, max_note, max_note - min_note)
          )
      if transpose_to_key is not None and (
          transpose_to_key < 0
          or transpose_to_key > note_seq.NOTES_PER_OCTAVE - 1
      ):
          raise ValueError(
              "transpose_to_key must be >= 0 and <= 11. "
              "transpose_to_key is %d." % transpose_to_key
          )
  
      self.min_note = min_note
      self.max_note = max_note
      self.transpose_to_key = transpose_to_key
  
file_path: magenta/magenta/models/improv_rnn/improv_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 to create a new ImprovRnnConfig object from inherited base classes: events_rnn_model with example: obj = ImprovRnnConfig(details, encoder_decoder, hparams, min_note, max_note, transpose_to_key)