chathasphere / pno-ai Goto Github PK
View Code? Open in Web Editor NEWMusic Transformer Sequence Generation in Pytorch
License: MIT License
Music Transformer Sequence Generation in Pytorch
License: MIT License
Some of the required steps will include:
-one-hot encoding the action sequences
-padding sequences to a uniform length for batching
-offsetting sequences for input/output pair ("hello worl", "ello world")
Think about how to initialize the training vector (?) All zeroes?
Helpful link(s):
Is there a test metric to evaluate performance of the model?
How will this trade be affected by the various data augmentation strategies?
Vs. Position embedding.
Wouldn't it be cool if you could play something on a MIDI controller and use it to seed the generator?
preprocess.py
should (probably) be converted to a class with an associated test module.
...and figure out how to load them when generating
Given the preprocessed data, convert these MIDI snippets to "Event Sequences."
Under the Time-shift representation, 413 events are possible:
A one-hot encoding turns each event into a 413-dimensional vector. A sequence of these is fed into a Neural Network.
Understand how it works!
Get additional metrics on loss
There should not be an appreciable difference in training results with padded (sub-max length) sequences thrown in...this will require validating that the padding masks work as expected.
Docstrings for modules, plus an updated README/ Wiki. Links to a clean Colab notebook could be useful for teaching how to train a model.
Hi,
Is there a way to access the weights to obtain a pre-trained model? I can't train it on my machine but would still like to do fine-tuning.
The 'saved-model' folder seems to be empty...
Seems to struggle with the edge case of extra long notes.
Check out this line:
new_length = note.end - sample_start
seems problematic if new_length is greater than 30 seconds.
MIT?
After running run.py and generate.py, it gave me the result that ‘no such file: saved_models/model.yaml’
I am doing research on the google magenta project (optimize the music transformer), your codes are valuable and useful for my research, so please help me to solve this problem.
Successfully extracted note sequences w/ pedal action.
According to research , the next steps should be:
Adapt the Sequence Encoder class to generate Note sequences from poorly-behaved, generated event sequences. For instance, set "note off" automatically if no note off event is provided for a pitch.
Embed a trained model in a flask application, generate MIDI sequences on the fly
play around with Colab!
is tpu an option? https://github.com/pytorch/xla/blob/master/contrib/colab/PyTorch_TPU_XRT_1_13.ipynb
Currently I dump a dictionary of parameters in the generate.py file. This could be more elegantly solved as a .yaml file.
Useful to have a record of how training went, plus logs are more responsive to an instance shutting off
Woohoo, dev ops
some links:
Hi. I was curious in trying your Music Transformer implementation, but I had to make some small changes to get it working.
Perhaps others may find some use from this information, and you might have insight.
First, in "train.py" line 147, there is a previously undeclared variable mask, which I believe should be x_mask.
Second, "generate.py" expects a "model.yaml" file that is not generated by "run.py": this was bypassed by directly setting the MusicTransformer model the same as in "run.py", and directly setting model_path to one of the checkpoints saved by "run.py"
Third, in "helpers.py", changed the line:
input_tensor = torch.LongTensor(input_sequence).unsqueeze(0)
into
model.cuda() input_tensor = torch.cuda.LongTensor(input_sequence).unsqueeze(0)
To fix an issue of mismatch between CPU and CUDA that arose in transformer.forward()
And lastly, because I was running this locally, I decreased batch size in run.py to fit my GPU.
Thanks.
Perhaps necessary if training on Colab. Save a model to gdrive every epoch.
Have the ability to convert encoded event sequences back into pretty_midi Note sequences and write them out to a MIDI file.
This will be useful both for checking the fidelity of the encoding process as well as being able to listen to the model's eventual output!
Consider using numpy arrays instead of a list of notes?
Will likely lead to efficiency gains in transposing/stretching samples.
This should go in the encoder module.
Hi, would it be possible to provide a link to a pre-trained model? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.