{"id":20535165,"url":"https://github.com/daniel05155/reinforcement-learning-in-music-generation","last_synced_at":"2026-04-14T19:32:55.817Z","repository":{"id":243534005,"uuid":"811843345","full_name":"daniel05155/Reinforcement-Learning-in-Music-Generation","owner":"daniel05155","description":"An implementation of  automated music composition using Deep Reinforcement Learning with PyTorch.","archived":false,"fork":false,"pushed_at":"2025-05-04T15:18:51.000Z","size":368,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T12:44:49.540Z","etag":null,"topics":["inverse-reinforcement-learning","music-generation","python","pytorch","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel05155.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-07T12:17:38.000Z","updated_at":"2025-05-04T15:18:54.000Z","dependencies_parsed_at":"2024-06-09T17:42:04.958Z","dependency_job_id":"cd9b0b6b-8de4-4fa9-ba42-8e44230aafa4","html_url":"https://github.com/daniel05155/Reinforcement-Learning-in-Music-Generation","commit_stats":null,"previous_names":["daniel05155/reinforcement-learning-in-music-generation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daniel05155/Reinforcement-Learning-in-Music-Generation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel05155%2FReinforcement-Learning-in-Music-Generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel05155%2FReinforcement-Learning-in-Music-Generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel05155%2FReinforcement-Learning-in-Music-Generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel05155%2FReinforcement-Learning-in-Music-Generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel05155","download_url":"https://codeload.github.com/daniel05155/Reinforcement-Learning-in-Music-Generation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel05155%2FReinforcement-Learning-in-Music-Generation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31812968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inverse-reinforcement-learning","music-generation","python","pytorch","reinforcement-learning"],"created_at":"2024-11-16T00:29:33.642Z","updated_at":"2026-04-14T19:32:55.797Z","avatar_url":"https://github.com/daniel05155.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated Music Composition Using Deep Reinforcement Learning\n\nThis repository is an implementation of automated music composition with Reinforcement Learning(RL) in PyTorch.\nWe design a novel deep reinforcement learning-based framework with the self-attention-based neural networks for long-sequence music generation, which differs from the conventional Generative Adversarial Network (GAN).\nAdditionally, we utilize  Deep Q Network (DQN)-based and Proximal Policy Optimization (PPO)-based techniquein Reinforcement Learning (RL) with the transformer model to generate pop-style piano music\nsequentially.\n\n## Model architecture\n###  DQN-Based Architecture\n![Aritecture](./dqn_policy/dqn_AIRL.png)\n\n###  PPO-Based Architecture\n![Aritecture](./ppo_policy/ppo_IRL.png)\n\n# Getting started\n## Install Dependencies\n\n```\npip install -r requirements.txt\n```\n\n## Dataset\nWe use the \"AIlabs-Pop1K7\" as training dataset, which can be download [here](https://github.com/YatingMusic/compound-word-transformer/tree/main).  \n\n\n## Pre-trained Weights\nLinear Transformer is our pre-trained weights of agent model, which can be downloaded [here](https://drive.google.com/file/d/1qRALPNx--GCzLJqrkEfP0bcm91jpkvcI/view?usp=sharing).\n\n\n## Run the Codes\nOur expertiment is based on the unconditional generation with Reinforcement Learning using PyTorch framework in Python.\n\n* Pretrain: \n```\npython agent_pretrain.py\n```\n\n* Training\n```\npython IRL_dqn_train.py\n\n```\n\n* Evaluation\n```\n## Generate midis songs in './gen_midis ##\n\npython testing-no-type-cp.py\n\n```\n\n## Demo\nOur generated midi files can be downloaded [here](https://drive.google.com/drive/folders/13HKoJLNTd_gKfzMb2OlZP4nKBRlLHfQ3?usp=sharing).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel05155%2Freinforcement-learning-in-music-generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel05155%2Freinforcement-learning-in-music-generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel05155%2Freinforcement-learning-in-music-generation/lists"}