Icon

02_​Training

Train RNN to generate piano music

This workflow uses preprocessed midi files to train a many to many RNN to generate music.

The brown nodes in the upper part define the network architecture. The chosen network architecture has 5 inputs for
- the notes
- the duration
- the offset difference to the previous note
- the initial hidden states of the LSTM
After an LSTM layer the network splitt into three, parallel, feedforward subnetworks with different activation functions:
- one for the notes
- one for the duration
- one for the offset difference
Afterwards the three subnetworks are collected.
In the Keras Network Learner node the Loss function is defined by selecting a loss for each feedforward subnetwork.
- Categorical Cross Entropy for the notes
- MSE for the duration and th offset difference.

Define network architecture Read preprocessed data and create initial state vectors Train and save the defined network To execute this workflow you need a conda environmentwith keras, music21, and tensorflow-mkl. This CondaEnvironment Propagation node creates a new environmentwith all necessary packages. NotesDurationOffset DiffReLU 128Notes: Softmax 79Duration: ReLU 1ReLu 100ReLU 100OffsetDiff: ReLU 1AdamEpochs: 100Initial state 1Initial state 2Preprocessed DataCreates a Conda Env Keras Collect Layer Keras Input Layer Keras Input Layer Keras Input Layer Keras ConcatenateLayer Keras ConcatenateLayer Keras LSTM Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Collect Layer Keras NetworkLearner Keras NetworkWriter Keras Input Layer Keras Input Layer Cross Joiner Create vectorwith 0s Table Reader Conda EnvironmentPropagation Define network architecture Read preprocessed data and create initial state vectors Train and save the defined network To execute this workflow you need a conda environmentwith keras, music21, and tensorflow-mkl. This CondaEnvironment Propagation node creates a new environmentwith all necessary packages. NotesDurationOffset DiffReLU 128Notes: Softmax 79Duration: ReLU 1ReLu 100ReLU 100OffsetDiff: ReLU 1AdamEpochs: 100Initial state 1Initial state 2Preprocessed DataCreates a Conda Env Keras Collect Layer Keras Input Layer Keras Input Layer Keras Input Layer Keras ConcatenateLayer Keras ConcatenateLayer Keras LSTM Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Dense Layer Keras Collect Layer Keras NetworkLearner Keras NetworkWriter Keras Input Layer Keras Input Layer Cross Joiner Create vectorwith 0s Table Reader Conda EnvironmentPropagation

Nodes

Extensions

Links