Coder Social home page Coder Social logo

askrbayern / idyompy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guimarion/idyompy

0.0 0.0 0.0 76.43 MB

This project propose a Python implementation for the IDyOM model made by Marcus Pearce.

License: GNU General Public License v3.0

Python 100.00%

idyompy's Introduction

IDyOMpy

IDyOMpy is a Python re-implementation of the IDyOM model made by Marcus Pearce. This implementation was made by Guilhem Marion, a Ph.D. student at Laboratoire des Systèmes Perceptifs, ENS, Paris. You can find the documentation on this website. Please cite the related paper if you use this work.

Get Started

Install conda if you don't have it (we highly recommend)

visit: https://conda.io/projects/conda/en/latest/user-guide/install/index.html

Create a new environment

conda create -n idyompyenv

Activate environment (you will have to activate it every time you need it and deactivate when you don't need it):

conda activate idyompyenv

Get the project from GitHub:

git clone https://github.com/GuiMarion/IDyOM.git

Enter the project

cd IDyOM

Install the dependencies:

pip install -r requirements.txt

Then use it!

To run a cross-validation with 5-folds:

python3 App.py -c yourFolder/ -k 5

To train/test:

python3 App.py -t trainingFolder/ -s testingFolder/

To replicate figures from Music of Silence Part II:

python3 App.py -t trainingFolder/ -d testingFolder/

To change the maximal order to 10:

python3 App.py -t trainingFolder/ -s testingFolder/ -m 10

To only use the pitch information:

python3 App.py -t trainingFolder/ -s testingFolder/ -v pitch

To compute genuine entropies and not use the approximation (it takes 5 times longer):

python3 App.py -t trainingFolder/ -s testingFolder/ -g 1

To compute the training monitoring (c.f. method paper):

python3 App.py -i preTrainingFolder/ -e trainingFolder/

To only use the long-term model:

python3 App.py -t trainingFolder/ -s testingFolder/ -l 1

To only use the short-term model:

python3 App.py -t trainingFolder/ -s testingFolder/ -b 1

Of course, all those parameters can be mixed to reach the behavior you are looking for.

Usage: usage App.py [options]

Options:

-h, --help 	show this help message and exit
-a TESTS, --test=TESTS
 	1 if you want to launch unittests
-t TRAIN_FOLDER, --train=TRAIN_FOLDER
 	Train the model with the passed folder
-s TRIAL_FOLDER, --surprise=TRIAL_FOLDER
 	Compute surprise over the passed folder. We use -t argument to train, if none are privided, we use the passed folder to cross-train.
-n TRIAL_FOLDER_SILENT, --silentNotes=TRIAL_FOLDER_SILENT
 	Compute silent notes probabilities over the passed folder. We use -t argument to train, if none are provided, we use the passed folder to cross-train.
-d THRESHOLD_MISSING_NOTES, --threshold_missing_notes=THRESHOLD_MISSING_NOTES
 	Define the threshold for choosing the missing notes (0.2 by default)
-z ZERO_PADDING, --zero_padding=ZERO_PADDING
 	Specify if you want to use zero padding in the surprise output, enable time representation (default 0)
-b SHORT_TERM_ONLY, --short_term=SHORT_TERM_ONLY
 	Only use short term model (default 0)
-c CROSS_EVAL, --cross_eval=CROSS_EVAL
 	Compute likelihoods by pieces over the passed dataset using k-fold cross-eval.
-l LONG_TERM_ONLY, --long_term=LONG_TERM_ONLY
 	Only use long term model (default 0)
-k K_FOLD, --k_fold=K_FOLD
 	Specify the k-fold for all cross-eval, you can use -1 for leave-one-out (default 5).
-q QUANTIZATION, --quantization=QUANTIZATION
 	Rythmic quantization to use (default 24).
-v VIEWPOINTS, --viewPoints=VIEWPOINTS
 	Viewpoints to use: pitch, length, interval, and velocity, separate them with comas, default pitch,length.
-m MAX_ORDER, --max_order=MAX_ORDER
 	Maximal order to use (default 20).
-g GENUINE_ENTROPIES, --genuine_entropies=GENUINE_ENTROPIES
 	Use this parameter to NOT use the entropy approximation. It takes longer (5 times) to compute but generate the genuine entropies, not an approximation (default 0).
-r FOLDER_DUPLICATES, --check_dataset=FOLDER_DUPLICATES
 	Check whether the passed folder contains duplicates.
-e TRAIN_TEST_FOLDER, --evolution=TRAIN_TEST_FOLDER
 	Train and evaluate over training on the passed folder (cross-val).
-i INTIALIZATION, --init_evolution=INTIALIZATION
 	Folder to initialize the evolution on.
-p NB_PIECES, --nb_pieces=NB_PIECES
 	Number of pieces to evaluate on during evolution training.
-o ORIGINAL_PPM, --original_ppm=ORIGINAL_PPM
 	Use original PPM algorithm to calculate likelihoods(default 0).

idyompy's People

Contributors

guimarion avatar askrbayern 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.