-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path마젠타명령어
14 lines (10 loc) · 1.03 KB
/
마젠타명령어
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 1. 데이터 전처리
# 1-1 미디파일 -> tfrecrod
!convert_dir_to_note_sequences --input_dir=/content/drive/MyDrive/class_data/tropical_melody_midis --output_file=/content/drive/MyDrive/class_data/tfrecord
# 1-2 tfrecrod -> 모델학습을 위한 데이터셋
!melody_rnn_create_dataset --input=/content/drive/MyDrive/class_data/tfrecord --output_dir=/content/drive/MyDrive/class_data/dataset --eval_ratio=0.0 --config=basic_rnn
참고 : https://github.com/magenta/magenta/tree/main/magenta/models/melody_rnn
# 2. 모델 학습
!melody_rnn_train --config=basic_rnn --run_dir=/content/drive/MyDrive/class_data/run1 --sequence_example_file=/content/drive/MyDrive/class_data/dataset/training_melodies.tfrecord --hparams="batch_size=64,rnn_layer_sizes=[64]" --num_training_steps=1000
# 3. 음악 생성
!melody_rnn_generate --config=basic_rnn --run_dir=/content/drive/MyDrive/class_data/run1 --output_dir=/content/drive/MyDrive/class_data/generated --num_outputs=100 --num_steps=128 --hparams="batch_size=64,rnn_layer_sizes=[64]" --primer_melody="[60]"