aiexperiments-ai-duet/server/magenta/models/basic_rnn/basic_rnn_create_dataset.py
2016-11-17 07:33:16 +03:00

49 lines
1.4 KiB
Python

# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
r"""Create a dataset for training and evaluating the basic RNN model.
Example usage:
$ bazel build magenta/models/basic_rnn:basic_rnn_create_dataset
$ ./bazel-bin/magenta/models/basic_rnn/basic_rnn_create_dataset \
--input=/tmp/note_sequences.tfrecord \
--output_dir=/tmp/basic_rnn \
--eval_ratio=0.10
See /magenta/models/shared/melody_rnn_create_dataset.py for flag descriptions.
"""
# internal imports
import tensorflow as tf
from magenta.models.basic_rnn import basic_rnn_encoder_decoder
from magenta.models.shared import melody_rnn_create_dataset
def get_pipeline():
return melody_rnn_create_dataset.get_pipeline(
basic_rnn_encoder_decoder.MelodyEncoderDecoder())
def main(unused_argv):
melody_rnn_create_dataset.run_from_flags(get_pipeline())
def console_entry_point():
tf.app.run(main)
if __name__ == '__main__':
console_entry_point()