Exemple #1
0
def create_generator(checkpoint, steps_per_beat=4, hparams=None):
    melody_encoder_decoder = basic_rnn_encoder_decoder.MelodyEncoderDecoder()
    details = generator_pb2.GeneratorDetails(id='basic_rnn',
                                             description='Basic RNN Generator')
    return melody_rnn_sequence_generator.MelodyRnnSequenceGenerator(
        details, checkpoint, melody_encoder_decoder,
        basic_rnn_graph.build_graph, steps_per_beat,
        {} if hparams is None else hparams)
Exemple #2
0
def create_generator(train_dir, steps_per_beat=4, hparams=None):
    melody_encoder_decoder = attention_rnn_encoder_decoder.MelodyEncoderDecoder(
    )
    details = generator_pb2.GeneratorDetails(
        id='attention_rnn', description='Attention RNN Generator')
    return melody_rnn_sequence_generator.MelodyRnnSequenceGenerator(
        details, train_dir, melody_encoder_decoder,
        attention_rnn_graph.build_graph, steps_per_beat,
        {} if hparams is None else hparams)
Exemple #3
0
def main(unused_argv):
    melody_encoder_decoder = basic_rnn_encoder_decoder.MelodyEncoderDecoder()
    details = generator_pb2.GeneratorDetails(id='basic_rnn',
                                             description='Basic RNN Generator')
    with melody_rnn_sequence_generator.MelodyRnnSequenceGenerator(
            details, melody_rnn_generate.get_train_dir(),
            melody_encoder_decoder, basic_rnn_graph.build_graph,
            melody_rnn_generate.get_steps_per_beat(),
            melody_rnn_generate.get_hparams()) as generator:
        melody_rnn_generate.run_with_flags(generator)
def create_generator(checkpoint,
                     bundle,
                     steps_per_quarter=4,
                     hparams=None,
                     generator_id=DEFAULT_ID):
    melody_encoder_decoder = basic_rnn_encoder_decoder.MelodyEncoderDecoder()
    details = generator_pb2.GeneratorDetails(id=generator_id,
                                             description='Basic RNN Generator')
    return melody_rnn_sequence_generator.MelodyRnnSequenceGenerator(
        details, checkpoint, bundle, melody_encoder_decoder,
        basic_rnn_graph.build_graph, steps_per_quarter,
        {} if hparams is None else hparams)
Exemple #5
0
def create_generator(checkpoint, bundle, steps_per_quarter=4, hparams=None):
  melody_encoder_decoder = attention_rnn_encoder_decoder.MelodyEncoderDecoder()
  details = generator_pb2.GeneratorDetails(
      id='attention_rnn',
      description='Attention RNN Generator')
  return melody_rnn_sequence_generator.MelodyRnnSequenceGenerator(
      details,
      checkpoint,
      bundle,
      melody_encoder_decoder,
      attention_rnn_graph.build_graph,
      steps_per_quarter,
      {} if hparams is None else hparams)