Building on top of https://github.com/IraKorshunova/folk-rnn/ and introducing a 'critic' that actively learns from feedback provided by a human in the loop
$ conda create -n folkcritic --file requirements.txt
$ conda env create -n folkcritic -f arm_requirements.yaml
$ conda activate folkcritic
$ python manage.py makemigrations $ python manage.py migrate
$ python manage.py createsuperuser
$ python manage.py runserver
- Navigate to 127.0.0.1:8000 and log in using the super user credentials to start training the critic (alternatively, navigate to the admin gui, 127.0.0.1:8000/admin, to create additional users)
Folkcritic can handle multiple sessions per user and all sessions are continously stored which means it is possible to go back and continue with a previous session at any time.
The main window shows the score and ABC notation of a song that has been generated by Folk RNN. It is possible to listen to the song by pressing Space bar, to like or dislike the song by pressing either the buttons or x and c respectively. The bottom displays information about the critic, such as how many songs it has been trained on and the critic score of the currently displayed song.
A higher critic score indicates a more likeable song. The system generates songs in the background until there is a song generated with a critic score above 0.5 or a total of 5 songs have been generated in which case the best scoring one is displayed.
- Liking or disliking a song retrains the critic and generates a new song that passes the criteria above
- It is possible to change the training parameters of the critic at any time and retrain it with all the songs that have been liked/disliked during the session
- It is also possible to reset the critic but it is worth noting that every time a new song is liked or disliked the critic is retrained on all the songs in the current session
- It is always possible to change the session or create a new one
- After enough training is done, the critic can be evaluated to see if it has managed to learn the preferences of the user
It is possible to evaluate the critic on any number of songs. Half of the songs are generated using the trained critic while the other half is generated using an untrained critic. The songs are then displayed to the user in random order and liked/disliked similar to the training but without displaying the critic score to the user.
After the user has liked/disliked the songs the result of the evaluation is displayed indicating whether the trained critic outperforms the untrained one.
It should be noted that the setup could be improved significantly by increasing the complexity of the TF model used for the critic. Currently only one layer is used which means the model just weighs the input and is not capable of really learning anything significant. Another obvious limitation is the number of songs generated before displaying a song to the user. If the critic is trained on a larger number of songs it would be beneficial to increase this number from 5 that is currently used. As the critic learns the average score of the songs from the generator tends to decrease which means fewer songs actually pass the critics scrutiny.