(config, min_events, max_events, eval_ratio)
return dag_pipeline.DAGPipeline(dag)
Returns the Pipeline instance which creates the RNN dataset.

  Args:
    config: A PerformanceRnnConfig.
    min_events: Minimum number of events for an extracted sequence.
    max_events: Maximum number of events for an extracted sequence.
    eval_ratio: Fraction of input to set aside for evaluation set.

  Returns:
    A pipeline.Pipeline instance.
Returns the Pipeline instance which creates the RNN dataset.
Returns the Pipeline instance which creates the RNN dataset .
def get_pipeline(config, min_events, max_events, eval_ratio):
  """Returns the Pipeline instance which creates the RNN dataset.

  Args:
    config: A PerformanceRnnConfig.
    min_events: Minimum number of events for an extracted sequence.
    max_events: Maximum number of events for an extracted sequence.
    eval_ratio: Fraction of input to set aside for evaluation set.

  Returns:
    A pipeline.Pipeline instance.
  """
  # Stretch by -5%, -2.5%, 0%, 2.5%, and 5%.
  stretch_factors = [0.95, 0.975, 1.0, 1.025, 1.05]

  # Transpose no more than a major third.
  transposition_range = list(range(-3, 4))

  partitioner = pipelines_common.RandomPartition(
      music_pb2.NoteSequence,
      ['eval_performances', 'training_performances'],
      [eval_ratio])
  dag = {partitioner: dag_pipeline.DagInput(music_pb2.NoteSequence)}

  for mode in ['eval', 'training']:
    sustain_pipeline = note_sequence_pipelines.SustainPipeline(
        name='SustainPipeline_' + mode)
    stretch_pipeline = note_sequence_pipelines.StretchPipeline(
        stretch_factors if mode == 'training' else [1.0],
        name='StretchPipeline_' + mode)
    splitter = note_sequence_pipelines.Splitter(
        hop_size_seconds=30.0, name='Splitter_' + mode)
    quantizer = note_sequence_pipelines.Quantizer(
        steps_per_second=config.steps_per_second, name='Quantizer_' + mode)
    transposition_pipeline = note_sequence_pipelines.TranspositionPipeline(
        transposition_range if mode == 'training' else [0],
        name='TranspositionPipeline_' + mode)
    perf_extractor = PerformanceExtractor(
        min_events=min_events, max_events=max_events,
        num_velocity_bins=config.num_velocity_bins,
        note_performance=config.note_performance,
        name='PerformanceExtractor_' + mode)
    encoder_pipeline = EncoderPipeline(config, name='EncoderPipeline_' + mode)

    dag[sustain_pipeline] = partitioner[mode + '_performances']
    dag[stretch_pipeline] = sustain_pipeline
    dag[splitter] = stretch_pipeline
    dag[quantizer] = splitter
    dag[transposition_pipeline] = quantizer
    dag[perf_extractor] = transposition_pipeline
    dag[encoder_pipeline] = perf_extractor
    dag[dag_pipeline.DagOutput(mode + '_performances')] = encoder_pipeline

  return dag_pipeline.DAGPipeline(dag)
def get_pipeline ( config , min_events , max_events , eval_ratio ) : # Stretch by -5%, -2.5%, 0%, 2.5%, and 5%. stretch_factors = [ 0.95 , 0.975 , 1.0 , 1.025 , 1.05 ] # Transpose no more than a major third. transposition_range = list ( range ( - 3 , 4 ) ) partitioner = pipelines_common . RandomPartition ( music_pb2 . NoteSequence , [ 'eval_performances' , 'training_performances' ] , [ eval_ratio ] ) dag = { partitioner : dag_pipeline . DagInput ( music_pb2 . NoteSequence ) } for mode in [ 'eval' , 'training' ] : sustain_pipeline = note_sequence_pipelines . SustainPipeline ( name = 'SustainPipeline_' + mode ) stretch_pipeline = note_sequence_pipelines . StretchPipeline ( stretch_factors if mode == 'training' else [ 1.0 ] , name = 'StretchPipeline_' + mode ) splitter = note_sequence_pipelines . Splitter ( hop_size_seconds = 30.0 , name = 'Splitter_' + mode ) quantizer = note_sequence_pipelines . Quantizer ( steps_per_second = config . steps_per_second , name = 'Quantizer_' + mode ) transposition_pipeline = note_sequence_pipelines . TranspositionPipeline ( transposition_range if mode == 'training' else [ 0 ] , name = 'TranspositionPipeline_' + mode ) perf_extractor = PerformanceExtractor ( min_events = min_events , max_events = max_events , num_velocity_bins = config . num_velocity_bins , note_performance = config . note_performance , name = 'PerformanceExtractor_' + mode ) encoder_pipeline = EncoderPipeline ( config , name = 'EncoderPipeline_' + mode ) dag [ sustain_pipeline ] = partitioner [ mode + '_performances' ] dag [ stretch_pipeline ] = sustain_pipeline dag [ splitter ] = stretch_pipeline dag [ quantizer ] = splitter dag [ transposition_pipeline ] = quantizer dag [ perf_extractor ] = transposition_pipeline dag [ encoder_pipeline ] = perf_extractor dag [ dag_pipeline . DagOutput ( mode + '_performances' ) ] = encoder_pipeline return dag_pipeline . DAGPipeline ( dag )