Add tutorial for multilabel training#254
Draft
PariaValizadeh wants to merge 4 commits intomainfrom
Draft
Conversation
raphaelschwinger
requested changes
Jul 25, 2024
Contributor
raphaelschwinger
left a comment
There was a problem hiding this comment.
Hey @PariaValizadeh,
Thanks for your work. To get the most out it for our readers, I would suggest the following changes:
- Load the data with our
BirdSetDataModulewithout any preprocessing so that it outputs batched waveforms - Pick the first sample of the batch from the train and test set (this will show the difference of focal / soundscapes)
- Make the sounds audible
- Now, add preprocessing to train a EfficientNet (EfficientNet because we can upload a pretrained model for that, and we included the EfficientNet in BirdSet), make sure to use the same preprocessing config as done in
configs/experiment/birdset_neurips24/HSN/DT/efficientnet.yaml - Visualize the first sample (now a spectrogram)
- Train the model (with same configs) and add the option to download the pretrained model
- Run test with
trainer.test() - Run model on previously selected test sample
- Print the predicted classes and the target class.
| "source": [ | ||
| "## load the test dataset\n", | ||
| "from datasets import load_dataset\n", | ||
| "hsn_test = load_dataset(\"DBD-research-group/BirdSet\",\"HSN\", split=\"test\")" |
Contributor
There was a problem hiding this comment.
@PariaValizadeh This will not use the cached version and therefore requires a complete redownload.
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "# Step 6: Visualization" |
Contributor
There was a problem hiding this comment.
@PariaValizadeh Could you move the visualization before the model training? So that the reader sees how the data gets preprocessed by the birdset pipeline?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a tutorial notebook to guide practictioners how to train a ResNet model for multilabel classification on the HSN dataset.