-
Notifications
You must be signed in to change notification settings - Fork 27
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
Refactor branching structure for finetuning vs. resuming training #229
Conversation
This will unfortunately break a number of our tests because we use an African Forest label asset everywhere, which will trigger as "not a subset" with this validation check and then conflict with predict_all_zamba_species = True. Edit: we can let |
1237dc2
to
e559499
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic looks good to me pending tests!
e559499
to
8d657be
Compare
…est since the default is now none
… as is relevant; also download checkpoint in config so we do not have to track all the relevant params all the way to instantiate model
…n validation; use helper functions to look up hparams; set defaults to none
✅ Deploy Preview for silly-keller-664934 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #229 +/- ##
========================================
+ Coverage 87.0% 87.2% +0.1%
========================================
Files 28 28
Lines 1931 1961 +30
========================================
+ Hits 1680 1710 +30
Misses 251 251
|
@pjbull this required quite a bit more fiddling to get everything working again. couple changes:
There are still improvements that could be made (e.g. instantiate model should probably just take the config object, we could better centralize the logic for looking up hparams), but I think this refactor is already at risk of scope creep and accomplishes the main task: ensuring that existing configuration parameters work with the new binary model. Ready for another look |
It's a little hard to see from the diff on the The first two test explicitly if use_default_model_labels is True or False in instantiate model. And then the next two tests set up the config and pass that object to This change also removes a duplicative test. Previously we had |
Refactoring in
instantiate_model
Refactors the logic in
instantiate_model
to branch onis_subset
to be more explicit. The previous logic tried to group the cases for replacing the head vs. resuming training.This new code change should not change the behavior, but should be more readable. The branching structure is now:
Validation for
is_subset
andpredict_all_zamba_species
This also allows us to enforce that
is_subset
(based on the model species and the labels species) is in agreement withpredict_all_zamba_species
. Notes:predict_all_zamba_species
is True by default. We assume that if you're finetuning on a subset of data, you still want all the zamba species. If you don't want this (e.g. you want duikers, elephants, and blanks only), you need to set this to False. This behavior is the same as before.predict_all_zamba_species
if you set a value (we make this field an optional boolean and use a pre validator).predict_all_zamba_labels
, we'll set predict_all_zamba_labels to False for you since your only option is a new head with a subset. This is the same result as before, where providing a subset yielded a new head. The difference is that before you could have set conflicting values, but not being a subset would have superseded the predict_all_zamba_labels field.Additional changes
predict_all_zamba_species
touse_default_model_classes
to apply to the blank nonblank model as wellOutstanding:
Closes #212
Closes https://github.com/drivendataorg/pjmf-zamba/issues/130