(config, transposition_range=(0,), eval_ratio=0.0)
return dag_pipeline.DAGPipeline(dag)
Returns the Pipeline instance which creates the RNN dataset.

  Args:
    config: A MelodyRnnConfig object.
    transposition_range: Collection of integer pitch steps to transpose.
    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, transposition_range=(0,), eval_ratio=0.0):
  """Returns the Pipeline instance which creates the RNN dataset.

  Args:
    config: A MelodyRnnConfig object.
    transposition_range: Collection of integer pitch steps to transpose.
    eval_ratio: Fraction of input to set aside for evaluation set.

  Returns:
    A pipeline.Pipeline instance.
  """
  partitioner = pipelines_common.RandomPartition(
      note_seq.NoteSequence,
      ['eval_melodies', 'training_melodies'],
      [eval_ratio])
  dag = {partitioner: dag_pipeline.DagInput(note_seq.NoteSequence)}

  for mode in ['eval', 'training']:
    time_change_splitter = note_sequence_pipelines.TimeChangeSplitter(
        name='TimeChangeSplitter_' + mode)
    transposition_pipeline = note_sequence_pipelines.TranspositionPipeline(
        transposition_range, name='TranspositionPipeline_' + mode)
    quantizer = note_sequence_pipelines.Quantizer(
        steps_per_quarter=config.steps_per_quarter, name='Quantizer_' + mode)
    melody_extractor = melody_pipelines.MelodyExtractor(
        min_bars=7, max_steps=512, min_unique_pitches=5,
        gap_bars=1.0, ignore_polyphonic_notes=False,
        name='MelodyExtractor_' + mode)
    encoder_pipeline = EncoderPipeline(config, name='EncoderPipeline_' + mode)

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

  return dag_pipeline.DAGPipeline(dag)
def get_pipeline ( config , transposition_range = ( 0 , ) , eval_ratio = 0.0 ) : partitioner = pipelines_common . RandomPartition ( note_seq . NoteSequence , [ 'eval_melodies' , 'training_melodies' ] , [ eval_ratio ] ) dag = { partitioner : dag_pipeline . DagInput ( note_seq . NoteSequence ) } for mode in [ 'eval' , 'training' ] : time_change_splitter = note_sequence_pipelines . TimeChangeSplitter ( name = 'TimeChangeSplitter_' + mode ) transposition_pipeline = note_sequence_pipelines . TranspositionPipeline ( transposition_range , name = 'TranspositionPipeline_' + mode ) quantizer = note_sequence_pipelines . Quantizer ( steps_per_quarter = config . steps_per_quarter , name = 'Quantizer_' + mode ) melody_extractor = melody_pipelines . MelodyExtractor ( min_bars = 7 , max_steps = 512 , min_unique_pitches = 5 , gap_bars = 1.0 , ignore_polyphonic_notes = False , name = 'MelodyExtractor_' + mode ) encoder_pipeline = EncoderPipeline ( config , name = 'EncoderPipeline_' + mode ) dag [ time_change_splitter ] = partitioner [ mode + '_melodies' ] dag [ quantizer ] = time_change_splitter dag [ transposition_pipeline ] = quantizer dag [ melody_extractor ] = transposition_pipeline dag [ encoder_pipeline ] = melody_extractor dag [ dag_pipeline . DagOutput ( mode + '_melodies' ) ] = encoder_pipeline return dag_pipeline . DAGPipeline ( dag )