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 to generate REMI data by models? #9

Closed
yen52205 opened this issue Jan 2, 2022 · 7 comments
Closed

How to generate REMI data by models? #9

yen52205 opened this issue Jan 2, 2022 · 7 comments

Comments

@yen52205
Copy link

yen52205 commented Jan 2, 2022

Hi,
In the paper, I notice that the model used for Emotion(4Q/Valence/Arousal) classification in Objective metrics is LSTM-Att + REMI.
But In the repo, the CP transformer model will generate a .mid file and a .npy for one music clip.
Could I use both of them to generate REMI data? And how to generate the REMI data type output?

  1. The evaluation method:
    image
  2. The metrics:
    image

thanks.

@joann8512
Copy link
Collaborator

REMI is the type of symbolic representation we used in the task. You can follow the steps here for data preprocessing.

@yen52205
Copy link
Author

yen52205 commented Jan 29, 2022

Firstly, thanks for answering this issue.

If it's possible, I want to check one more thing about getting REMI from model generation.
Models will generate .npy files, and are they the same as "corpus" in preprocessing?
So that I should use "From Corpus to Representation" part in preprocessing to get REMI from .npy files?

Below is part of description from the link you mentioned.
ex.
image

@joann8512
Copy link
Collaborator

Just to be clear, the step of getting REMI representation is only during the steps of data preprocessing, so we haven't gone into the model yet. And yes, the codes for the step "Corpus to Representation" is explicitly for converting midi to the representation.

@yen52205
Copy link
Author

Thanks for your answering
But I'm still confusing about the metrics in paper.

In the paper, you used LSTM-att+REMI to test the generation model's outputs.
But in your post-processing code, the generation model would output npy file and MIDI file.
Then how could I use LSTM-att +REMI to test the output of generation model (npy and MIDI files), when LSTM-att+REMI was supposed to eat REMI files?

if I want to reproduce the results in paper, should I use "Corpus to Representation" on the MIDI files that generated by generation model to get REMI representation, and feed those REMI files into LST-att+REMI to get classification accuracy?

Thanks.

@joann8512
Copy link
Collaborator

  1. LSTM-att+REMI was used for the task of emotion classification
  2. The generation model only outputs MIDI file, no npy file
  3. Per your need, this link here shows you how to transform MIDI files to REMI representation

@yen52205
Copy link
Author

yen52205 commented Feb 7, 2022

  1. LSTM-att+REMI was used for the task of emotion classification
  2. The generation model only outputs MIDI file, no npy file
  3. Per your need, this link here shows you how to transform MIDI files to REMI representation

reply for 2., following code is from this github ( workspace/transformer/main_cp.py), I thought it would generate npy files in the end of model generation.
image

@joann8512
Copy link
Collaborator

To your earlier question "Models will generate .npy files, and are they the same as "corpus" in preprocessing?", if you go check the function write_midi as used in line# 454 (which also uses the parameter res), you can see that it is not corpus that's being written into npy.

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