Skip to content

An implementation of automated music composition using Deep Reinforcement Learning with PyTorch.

Notifications You must be signed in to change notification settings

daniel05155/Reinforcement-Learning-in-Music-Generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Automated Music Composition Using Deep Reinforcement Learning

This repository is an implementation of automated music composition with Reinforcement Learning(RL) in PyTorch. The Deep Q Network (DQN) is our primary policy for automated music composition. Within the RL framework, a well-designed reward module is essential for success. Therefore, we developed the Inverse Reinforcement Learning (IRL) framework for the purpose of reward learning within an adversarial framework.  The advantage of our IRL algorithm is that it not only enhances policy optimization but also requires no music theory-based rules. The overall system leads to more diverse melodies and maintains the harmony of the generated music sequences.

Model architecture

Aritecture

Getting started

Install Dependencies

pip install -r requirements.txt

Dataset

We use the "AIlabs-Pop1K7" as training dataset, which can be download here.

Pre-trained Weights

Linear Transformer is our pre-trained weights of agent model, which can be downloaded here.

Run the Codes

Our expertiment is based on the unconditional generation with Reinforcement Learning using PyTorch framework in Python.

  • Pretrain:
python agent_pretrain.py
  • Training
python IRL_dqn_train.py

  • Evaluation
## Generate midis songs in './gen_midis ##

python testing-no-type-cp.py

Demo

Our generated midi files can be downloaded here.

About

An implementation of automated music composition using Deep Reinforcement Learning with PyTorch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages