Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I train with my own dataset? #3

Open
aletote opened this issue Feb 1, 2021 · 1 comment
Open

How do I train with my own dataset? #3

aletote opened this issue Feb 1, 2021 · 1 comment

Comments

@aletote
Copy link

aletote commented Feb 1, 2021

Thanks.

@instr3
Copy link
Member

instr3 commented Feb 3, 2021

Hi Aletote,

Currently, you need to write your own conversion code since different datasets have different formats. A brief, incomplete documentation of the data format we use:

  1. You will need two files datasetName_note_chords.length.npy and datasetName_note_chords.npy.
The datasetName_note_chords.npy file is a matrix with shape [T, D]. T is the number of frames (one frame is a sixteenth note).
    The second dimension is a concatenation of the following:
    * 1-D notes: range 0-129. 0 for silence, 1 for sustain, 2-129 for onsets with 128 MIDI pitches.
    * 1-D root: range 0-11, or -1. the chord root. -1 for non-chord.
    * 12-D chroma: boolean. the pitch class of the chord.
    * 1-D bass: range 0-11, or -1. the chord bass note. -1 for non-chord. In the nottingham dataset, we use the root note as the bass note.
    * 1-D beat: boolean. Whether this frame is a beat frame (unused in training)
    * 1-D downbeat: boolean. Whether this frame is a downbeat frame (unused in training)
  1. Assume your dataset has N songs, you should concatenate the matrix along the first axis (T axis) and record the lengths of each song in datasetName_note_chords.length.npy (i.e., datasetName_note_chords.length.npy is an integer array of size N).

You can refer to nottingham_note_chords.length.npy and nottingham_note_chords.npy for an example.

  1. After that, you can create a dataset split file datasetName_note_chords.split.txt to split the indices of songs (starting from 0 to N-1) to the training, validation and test split (3 lines, one line each split).

  2. Then you can run training on your custom dataset:

seq_attention_model.py datasetName 4
seq_attention_bidirectional_model.py datasetName 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants