In this chapter, we looked at generating melodies, using both monophonic and polyphonic models.
We first started by looking at LSTM cells and their usage in RNNs to keep information for a long period of time, using forget, input, and output gates.
Then, we generated melodies with the Melody RNN, using multiple pre-trained models such as basic, lookback, and attention. We saw that the basic model cannot learn repeating structure, because its input vector encoding do not contain such information. We then looked at the lookback encoding, where step position in bar and repeating structure are encoded into the input vector, making it possible for the model to learn such information. We finally saw the attention model, where the attention mechanism makes it possible to look at multiple previous steps, using an attention mask that gives a weight to each step.
Finally, we generated...