I am very new at this, so I might be wrong about my choice of model, but my problem is the following. I am trying to generate music, hence the reason I am using an LSTM. I have the following sequence of length 6 and 3 features, where each of one these features is a class, [['n','16','a4'],['n', '16', 'b4'],['r', '8' ,'b4'] ...], and I want to predict the next step in this sequence which will be for e.g. ['n', '8', 'c5'].

I decided to use an LSTM and treat it as a multivariate timeseries, but I am confused as to what the output shape could be. My current model looks like this

model = Sequential()
model.add(LSTM(50, input_shape=(network_input.shape[1], network_input.shape[2])))
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics = ['accuracy'])

I am sure that this is wrong, especially when it comes to the output layer, because I know that when dealing with classification, the output layer must be the size of possible classes. But I don't know how to translate this here, since I have multiple classes for each feature. Can anyone advise as to how to approach this ?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.