# How to put multiple features into RNN input vector

I am trying to code a recurrent neural network (LSTM) to create music in python and was considering using multiple features instead of just the note pitch as an input into the network. Initially I had just the note pitch so it was fed into the network by one-hot encoding it. The other two features I want to add are the note duration and the offset between the notes. How should the input vector be organised so that all the data is fed through the network?

I have tried combining all of the data into a long vector with all 3 features one-hot encoded and then concatenated but this caused the output to become 'NaN'. Any help would be appreciated.

Link a gist of my code:

https://gist.github.com/treutm/1b1f49e3d0a9de53cd67c136292f329f

• which deep learning library are you using? tensor-flow or pytorch? Also for this type of question, please include your code in the question. – Louis T Feb 9 '19 at 9:56
• @LouisT I’m using a numpy implementation of an LSTM should I just put the code for forward propagation? – treutm Feb 9 '19 at 9:57
• The NaN can occur at backdrop as well. If your code is too long, put it in a gist on GitHub and include a link to it. – Louis T Feb 9 '19 at 10:02
• @LouisT Just added the link to the gist. Just checking, can you view it? (haven't made a gist before) – treutm Feb 9 '19 at 10:41
• congrats on your first gist :) and yes, I can see the gist. Can you try to modify this code such that someone can simply copy the code and run it on their machine to reproduce the NaN you are seeing? You might need to save the output your read_mini in another gist. – Louis T Feb 9 '19 at 11:12