Giter VIP home page Giter VIP logo

midigen's Introduction

midigen

Test task for MIDI files generation using GPT-2

Preparation Guide

  1. Clone the repository
  2. Install modules from requirements.txt
  3. Download pre-trained models with script download_models.sh from Saved_models folder

Training guide

  1. Choose one of experiments config from Experiments folder or create your own (instructions on these are yet to come)
  2. Run python train.py --yaml_path='/path/to/experiment.yml'' in scripts folder

Generation guide

  1. Choose one of the models, downloaded with script or trained yourself
  2. Run python generate.py --model_type='GPT' --model_path='/path/to/saved/model' --output_dir='/dir/to/output/midi' --dataset_pickle='/path/to/data/split.pkl' --number_of_seqs=number_of_files_to_generate --max_seq=max_primer_len --target_len=output_len --beam=beam_search_number --device='cuda:3'
  • If beam is equal to 0 no beam search is used, instead we use regular categorial distribution from token probabilities
  • Number of seqs is number of sequences used as primer to generate MIDI

!!!

Using this library you may encounter torch.device problems. I suggest you change value of TORCH_CUDA_DEVICE in midigen.utils.constants to your used device or even disable CUDA by setting USE_CUDA to 0. Later on I will implement constant-agnostic device choice to prevent such errors

Current progress

  • Implement MusicTransformer
  • Implement GPT-2
  • Add RPR support for GPT-2
  • Add beam search to MIDI generation in model
  • Implement training in Trainer
  • Add model saving / loading
  • Implement MIDI generation
  • Remove get_device() function from everywhere. Replace with single device
  • Add MusicTransformer support for training/generation if needed
  • Ensure correctness of beam search generation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.