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

Upgrade model training to fastai v2 #215

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BrunoGrandePhD
Copy link
Collaborator

The goal of this PR is to figure out how to upgrade the model training code in 2_FastAI_StarterScript.ipynb to use fastai v2 (without fastaudio) and attain equivalent performance. After multiple attempts, I settled on the approach of writing two notebooks in parallel:

  1. fastai-migration-notes-v1.ipynb: This is mostly code copied from 2_FastAI_StarterScript.ipynb, but with additional exploration on my part (e.g. to confirm certain config values). I also output the data in this notebook so I can compare and contrast with the equivalent code in the second notebook.
  2. fastai-migration-notes-v2.ipynb: This notebook demonstrates model training using fastai v2 without fastaudio. I was able to get an accuracy on the validation set (20%) up to 94.9%, which is slightly higher than the 93.7% achieved in the original 2_FastAI_StarterScript.ipynb notebook. While I don't know how much we can rely on these performance gains, my goal was to achieve similar (or greater) performance to make sure I hadn't introduced a regression. I believe this goal was met.

Fixes #214

@pastorep
Copy link
Collaborator

pastorep commented Nov 22, 2024

Super nice work to get us moving away from deprecated fastaudio package and toward standard torchaudio package. Especially cool to see your experiments proving viability.

I wonder if it makes sense to stick the notebooks in a notes/ folder, to accentuate that no future dev will run these notebooks. I ack that they're already titled -notes.ipynb, but still could be confusing since they're in same directory as our production code.

@pastorep
Copy link
Collaborator

Although it does seem that fastai-migration-notes-v2.ipynb may be a reasonable plug-in replacement for 2_FastAI_StarterScript.ipynb. Is that your intention?

@BrunoGrandePhD
Copy link
Collaborator Author

Given your suggestion in #216, I propose that we close this PR and add both notebooks to the new repo in the notebooks/ subfolder with documentation pointing to 2_FastAI_StarterScript.ipynb in this repo. Once that repo is up and running, we can update the documentation in ModelTraining with a link to the new training code.

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

Successfully merging this pull request may close these issues.

Upgrade fastai to version 2
2 participants