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

  Args:
    config: An EventSequenceRnnConfig.
    min_steps: Minimum number of steps for an extracted sequence.
    max_steps: Maximum number of steps 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_steps, max_steps, eval_ratio):
  """Returns the Pipeline instance which creates the RNN dataset.

  Args:
    config: An EventSequenceRnnConfig.
    min_steps: Minimum number of steps for an extracted sequence.
    max_steps: Maximum number of steps for an extracted sequence.
    eval_ratio: Fraction of input to set aside for evaluation set.

  Returns:
    A pipeline.Pipeline instance.
  """
  # Transpose up to a major third in either direction.
  # Because our current dataset is Bach chorales, transposing more than a major
  # third in either direction probably doesn't makes sense (e.g., because it is
  # likely to exceed normal singing range).
  transposition_range = range(-4, 5)

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

  for mode in ['eval', 'training']:
    time_change_splitter = note_sequence_pipelines.TimeChangeSplitter(
        name='TimeChangeSplitter_' + mode)
    quantizer = note_sequence_pipelines.Quantizer(
        steps_per_quarter=config.steps_per_quarter, name='Quantizer_' + mode)
    transposition_pipeline = note_sequence_pipelines.TranspositionPipeline(
        transposition_range, name='TranspositionPipeline_' + mode)
    poly_extractor = PolyphonicSequenceExtractor(
        min_steps=min_steps, max_steps=max_steps, name='PolyExtractor_' + mode)
    encoder_pipeline = event_sequence_pipeline.EncoderPipeline(
        polyphony_lib.PolyphonicSequence, config.encoder_decoder,
        name='EncoderPipeline_' + mode)

    dag[time_change_splitter] = partitioner[mode + '_poly_tracks']
    dag[quantizer] = time_change_splitter
    dag[transposition_pipeline] = quantizer
    dag[poly_extractor] = transposition_pipeline
    dag[encoder_pipeline] = poly_extractor
    dag[dag_pipeline.DagOutput(mode + '_poly_tracks')] = encoder_pipeline

  return dag_pipeline.DAGPipeline(dag)
def get_pipeline ( config , min_steps , max_steps , eval_ratio ) : # Transpose up to a major third in either direction. # Because our current dataset is Bach chorales, transposing more than a major # third in either direction probably doesn't makes sense (e.g., because it is # likely to exceed normal singing range). transposition_range = range ( - 4 , 5 ) partitioner = pipelines_common . RandomPartition ( music_pb2 . NoteSequence , [ 'eval_poly_tracks' , 'training_poly_tracks' ] , [ eval_ratio ] ) dag = { partitioner : dag_pipeline . DagInput ( music_pb2 . NoteSequence ) } for mode in [ 'eval' , 'training' ] : time_change_splitter = note_sequence_pipelines . TimeChangeSplitter ( name = 'TimeChangeSplitter_' + mode ) quantizer = note_sequence_pipelines . Quantizer ( steps_per_quarter = config . steps_per_quarter , name = 'Quantizer_' + mode ) transposition_pipeline = note_sequence_pipelines . TranspositionPipeline ( transposition_range , name = 'TranspositionPipeline_' + mode ) poly_extractor = PolyphonicSequenceExtractor ( min_steps = min_steps , max_steps = max_steps , name = 'PolyExtractor_' + mode ) encoder_pipeline = event_sequence_pipeline . EncoderPipeline ( polyphony_lib . PolyphonicSequence , config . encoder_decoder , name = 'EncoderPipeline_' + mode ) dag [ time_change_splitter ] = partitioner [ mode + '_poly_tracks' ] dag [ quantizer ] = time_change_splitter dag [ transposition_pipeline ] = quantizer dag [ poly_extractor ] = transposition_pipeline dag [ encoder_pipeline ] = poly_extractor dag [ dag_pipeline . DagOutput ( mode + '_poly_tracks' ) ] = encoder_pipeline return dag_pipeline . DAGPipeline ( dag )