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
This should go in the encoder module.
Vs. Position embedding.
Get additional metrics on loss
Wouldn't it be cool if you could play something on a MIDI controller and use it to seed the generator?
Is there a test metric to evaluate performance of the model?
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.
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.
...and figure out how to load them when generating
Successfully extracted note sequences w/ pedal action.
According to research , the next steps should be:
Woohoo, dev ops
Currently I dump a dictionary of parameters in the generate.py file. This could be more elegantly solved as a .yaml file.
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.
MIT?
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.
How will this trade be affected by the various data augmentation strategies?
Docstrings for modules, plus an updated README/ Wiki. Links to a clean Colab notebook could be useful for teaching how to train a model.
Embed a trained model in a flask application, generate MIDI sequences on the fly
Hi, would it be possible to provide a link to a pre-trained model? Thanks!
Consider using numpy arrays instead of a list of notes?
Will likely lead to efficiency gains in transposing/stretching samples.
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.
preprocess.py
should (probably) be converted to a class with an associated test module.
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!
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.
Useful to have a record of how training went, plus logs are more responsive to an instance shutting off
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):
play around with Colab!
is tpu an option? https://github.com/pytorch/xla/blob/master/contrib/colab/PyTorch_TPU_XRT_1_13.ipynb
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...
Perhaps necessary if training on Colab. Save a model to gdrive every epoch.
Understand how it works!
some links:
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.