from __future__ import print_function
import IPython
import sys
from music21 import * # music21为一个库,需要用pip进行安装import numpy as np
from grammar import *
from qa import *
from preprocess import *
from music_utils import *
from data_utils import *
from keras.models import load_model, Model
from keras.layers import Dense, Activation, Dropout, Input, LSTM, Reshape, Lambda, RepeatVector
from keras.initializers import glorot_uniform
from keras.utils import to_categorical
from keras.optimizers import Adam
from keras import backend as K
# GRADED FUNCTION: djmodel=defdjmodel(Tx, n_a, n_values):"""
Implement the model
Arguments:
Tx -- length of the sequence in a corpus
n_a -- the number of activations used in our model
n_values -- number of unique values in the music data
Returns:
model -- a keras model with the
"""# Define the input of your model with a shape
X = Input(shape=(