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.

Annotations and comments
  • 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 environment with keras, music21, and tensorflow-mkl. This Conda Environment Propagation node creates a new environment with all necessary packages.
  • Creates a Conda Env
  • Only 0s
  • Size of state vector
  • ReLU 128
  • Notes: Softmax 79
  • Duration: ReLU 1
  • ReLu 100
  • OffsetDiff: ReLU 1
  • Offset Diff
  • Initial state 1
  • Initial state 2
  • Adam Epochs: 100
  • Preprocessed Data

Nodes

Extensions

Links