(self, melody, noisy, encode_performance_fn, encode_score_fns,
               augment_fns, num_replications, *unused_args, **unused_kwargs)
Initialize a ConditionalExtractExamplesDoFn.

    If any of the `encode_score_fns` or `encode_performance_fn` returns an empty
    encoding for a particular example, the example will be discarded.

    Args:
      melody: If True, uses both melody and performance conditioning.
      noisy: If True, uses a perturbed version of the performance for
             conditioning. Currently only supported for mel & perf autoencoder.
      encode_performance_fn: Performance encoding function. Will be applied to
          the performance NoteSequence and the resulting encoding will be stored
          as 'targets' in each example.
      encode_score_fns: Optional dictionary of named score encoding functions.
          If provided, each function will be applied to the score NoteSequence
          and the resulting encodings will be stored in each example.
      augment_fns: Optional list of data augmentation functions. If provided,
          each function will be applied to each performance NoteSequence (and
          score, when using scores), creating a separate example per
          augmentation function. Should not modify the NoteSequence.
      num_replications: Number of times input NoteSequence protos will be
          replicated prior to splitting.

    Raises:
      ValueError: If the maximum hop size is less than twice the minimum hop
          size, or if `encode_score_fns` and `random_crop_length` are both
          specified.
Initialize a ConditionalExtractExamplesDoFn.
Initialize a ConditionalExtractExamplesDoFn .
def __init__(self, melody, noisy, encode_performance_fn, encode_score_fns,
               augment_fns, num_replications, *unused_args, **unused_kwargs):
    """Initialize a ConditionalExtractExamplesDoFn.

    If any of the `encode_score_fns` or `encode_performance_fn` returns an empty
    encoding for a particular example, the example will be discarded.

    Args:
      melody: If True, uses both melody and performance conditioning.
      noisy: If True, uses a perturbed version of the performance for
             conditioning. Currently only supported for mel & perf autoencoder.
      encode_performance_fn: Performance encoding function. Will be applied to
          the performance NoteSequence and the resulting encoding will be stored
          as 'targets' in each example.
      encode_score_fns: Optional dictionary of named score encoding functions.
          If provided, each function will be applied to the score NoteSequence
          and the resulting encodings will be stored in each example.
      augment_fns: Optional list of data augmentation functions. If provided,
          each function will be applied to each performance NoteSequence (and
          score, when using scores), creating a separate example per
          augmentation function. Should not modify the NoteSequence.
      num_replications: Number of times input NoteSequence protos will be
          replicated prior to splitting.

    Raises:
      ValueError: If the maximum hop size is less than twice the minimum hop
          size, or if `encode_score_fns` and `random_crop_length` are both
          specified.
    """
    super(ConditionalExtractExamplesDoFn, self).__init__(
        *unused_args, **unused_kwargs)
    self._melody = melody
    self._noisy = noisy
    self._encode_performance_fn = encode_performance_fn
    self._encode_score_fns = encode_score_fns
    self._num_replications = num_replications
    self._augment_fns = augment_fns if augment_fns else [lambda ns: ns]
    self._decode_performance_fn = music_encoders.MidiPerformanceEncoder(
        steps_per_second=100, num_velocity_bins=32, min_pitch=21, max_pitch=108,
        add_eos=False).decode
def __init__ ( self , melody , noisy , encode_performance_fn , encode_score_fns , augment_fns , num_replications , * unused_args , * * unused_kwargs ) : super ( ConditionalExtractExamplesDoFn , self ) . __init__ ( * unused_args , * * unused_kwargs ) self . _melody = melody self . _noisy = noisy self . _encode_performance_fn = encode_performance_fn self . _encode_score_fns = encode_score_fns self . _num_replications = num_replications self . _augment_fns = augment_fns if augment_fns else [ lambda ns : ns ] self . _decode_performance_fn = music_encoders . MidiPerformanceEncoder ( steps_per_second = 100 , num_velocity_bins = 32 , min_pitch = 21 , max_pitch = 108 , add_eos = False ) . decode