Giter VIP home page Giter VIP logo

msprior's Introduction

MSPrior

A multi(scale/stream) prior model for realtime temporal learning

Disclaimer

This is an experimental project that will be subject to lots of changes.

Installation

pip install acids-msprior

Usage

MSPrior assumes you have

  1. A pretrained RAVE model exported without streaming as a torchscript .ts file
  2. The dataset on which RAVE has been trained (a folder of audio files).

1. Preprocessing

MSPrior operates on the latent representation yielded by RAVE. Therefore, we start by encoding the entirety of the audio dataset into a latent dataset.

msprior preprocess --audio /path/to/audio/folder --out_path /path/to/output/folder --rave /path/to/pretrained/rave.ts

2. Training

MSPrior has several possible configurations. The default is a ALiBi-Transformer with a skip prediction backend, which can run in realtime on powerful computers (e.g. Apple M1-2 chips, GPU enabled Linux stations). A less demanding configuration is a large GRU. Both configurations can launched be using

msprior train --config configuration  --db_path /path/to/preprocessed/dataset --name training_name --pretrained_embedding /path/to/pretrained/rave.ts

Here are the different configurations available

Name Description
decoder_only Unconditional autoregressive models, relying solely on previous samples to produce a prediction. The recurrent mode uses a Gated Recurrent Unit instead of a Transformer, suitable for small datasets and lower computational requirements.
recurrent
encoder_decoder Encoder / decoder autoregressive mode, where the generation process is conditioned by an external input (aka seq2seq). The continuous version is based on continuous features instead of a discrete token sequence.
encoder_decoder_continuous

The configurations decoder_only and recurrent are readily usable, the seq2seq variants depends on another project called rave2vec that will be open sourced in the near future.

3. Export

Export your model to a .ts file that you can load inside the nn~ external for Max/MSP and PureData.

msprior export --run /path/to/your/run

WARNING

If you are training on top of a continuous rave (i.e. anything but the discrete configuration), you shoud pass the --continuous flag during export

msprior export --run /path/to/your/run --continuous

4. Realtime usage

Once exported, you can load the model inside MaxMSP following the image below.

Max Msp usage

Note that additional inputs (e.g. semantic) are only available when using seq2seq models. The last output yields the perplexity of the model.

Funding

This work is funded by the DAFNE+ NĀ° 101061548 project, and is led at IRCAM in the STMS lab.

msprior's People

Contributors

caillonantoine avatar devstermarts avatar

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.