pivaenist / README.md
TomRB22's picture
Modified sources
5b818f3
|
raw
history blame
No virus
7.34 kB
---
license: mit
language:
- en
tags:
- music
- autoencoder
- variational autoencoder
- music generation
---
# Pivaenist
Pivaenist is a two-minute, random piano music generator with a VAE architecture.
By the use of the aforementioned autoencoder, it allows the user to encode piano music pieces and to generate new ones.
## Model Details
### Model Description
<!-- Going to include a graph of the VAE, with a description below. -->
- **Developed by:** TomRB22
- **Model type:** Variational autoencoder
- **License:** MIT
### Sources
<!-- Provide the basic links for the model. -->
**Code:** Some of the code of this repository includes modifications (not the entire code, due to the differences in the architecture) or implementations from the following sites:
1. [TensorFlow. (n.d.). Generate music with an RNN | TensorFlow Core](https://www.tensorflow.org/tutorials/audio/music_generation) - Tensorflow tutorial where pretty-midi is used
2. [Han, X. (2020, September 1). VAE with TensorFlow: 6 Ways](https://towardsdatascience.com/vae-with-tensorflow-6-ways-9c689cb76829) - VAE explanation and code
3. [Li, C. (2019, April 15). Less pain, more gain: A simple method for VAE training with less of that KL-vanishing agony. Microsoft Research.](https://www.microsoft.com/en-us/research/blog/less-pain-more-gain-a-simple-method-for-vae-training-with-less-of-that-kl-vanishing-agony/) - Microsoft article on the KL training schedule which was applied in this model
There might be acknowledgments missing. If you find some other resemblance to a site's code, please notify me and I will make sure of including it.
## Uses
<!-- MENTION COLAB HERE -->
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
### Using pivaenist in colab
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
If you preferred directly using or testing the model without the need to install it, you can use the following colab notebook and follow its instructions. Moreover, this serves as an example of use.
[colab link]
[More Information Needed]
### Downstream Use [optional]
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
[More Information Needed]
### Out-of-Scope Use
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
[More Information Needed]
## Bias, Risks, and Limitations
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
[More Information Needed]
### Recommendations
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
## Installation
To install the model, you will need to **change your working directory to the desired installation location** and execute the following commands:
**_Windows_**
```console
git clone https://huggingface.co/TomRB22/pivaenist
sudo apt install -y fluidsynth
pip install -r ./pivaenist/requirements.txt
```
**_Mac_**
```console
git clone https://huggingface.co/TomRB22/pivaenist
brew install fluidsynth
pip install -r ./pivaenist/requirements.txt
```
The first one will clone the repository. Then, fluidsynth, a real-time MIDI synthesizer, is also set up in order to be used by the pretty-midi library. With the last line, you will make sure to have all dependencies on your system.
[More Information Needed]
## Training Details
[TODO: SONG MAP IMAGE]
Pivaenist was trained on the [MAESTRO v2.0.0 dataset](https://magenta.tensorflow.org/datasets/maestro), which contains 1282 midi files [check it in colab]. Their preprocessing involves splitting each note in pitch, duration and step, which compose a column of a 3xN matrix (which we call song map), where N is the number of notes and a row represents sequentially the different pitches, durations and steps. The VAE's objective is to reconstruct these matrices, making it then possible to generate random maps by sampling from the distribution, and then convert them to a MIDI file.
### Training Data
<!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
[More Information Needed]
### Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### Preprocessing [optional]
[More Information Needed]
#### Training Hyperparameters
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
#### Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
[More Information Needed]
## Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Data Card if possible. -->
[More Information Needed]
#### Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
[More Information Needed]
#### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
[More Information Needed]
### Results
[More Information Needed]
#### Summary
## Model Examination [optional]
<!-- Relevant interpretability work for the model goes here -->
[More Information Needed]
## Environmental Impact
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** [More Information Needed]
- **Hours used:** [More Information Needed]
- **Cloud Provider:** [More Information Needed]
- **Compute Region:** [More Information Needed]
- **Carbon Emitted:** [More Information Needed]
## Technical Specifications [optional]
### Model Architecture and Objective
[More Information Needed]
### Compute Infrastructure
[More Information Needed]
#### Hardware
[More Information Needed]
#### Software
[More Information Needed]
## Citation [optional]
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
**BibTeX:**
[More Information Needed]
**APA:**
[More Information Needed]
## Glossary [optional]
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
[More Information Needed]
## More Information [optional]
[More Information Needed]
## Model Card Authors [optional]
[More Information Needed]
## Model Card Contact
[More Information Needed]
## Documentation
###