[Draft] Make processing service support model retraining - #167
Draft
mohamedelabbas1996 wants to merge 1 commit into
Draft
[Draft] Make processing service support model retraining#167mohamedelabbas1996 wants to merge 1 commit into
mohamedelabbas1996 wants to merge 1 commit into
Conversation
Antenna is gaining the ability to retrain a classifier head from species people have verified, but only some models are worth retraining: a head over a frozen backbone is cheap, a detector or a model trained end to end is not. A model now declares whether its head can be retrained, and the worker reports that in the algorithm config it registers with Antenna. The flag is per algorithm rather than per service, because a service usually hosts several pipelines and only one of them has a retrainable head. Nothing is trainable unless it says so, and nothing here trains anything. Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Antenna is gaining the ability to retrain a classifier head from species that people have verified. Only some models are worth retraining — a classifier head over a frozen backbone is cheap, a detector or a model trained end to end is not — so Antenna needs to be told which is which before it can offer retraining for a pipeline.
This adds that one flag. A model declares
trainable, the worker reports it in the algorithm config it registers with Antenna, and Antenna uses it to decide whether retraining applies. Nothing else changes: no model is trainable unless it says so, and nothing here trains anything.List of Changes
trainableattribute onInferenceBaseClass, defaulting toFalsetrainablefield onAlgorithmConfigResponsemake_algorithm_response()andmake_algorithm_config_response()Detailed Description
The flag is per algorithm rather than per service. A processing service usually hosts several pipelines and only one of them has a retrainable head, so a single service-level flag would not tell Antenna which head to touch.
The default is
Falseeverywhere, and the builders read it withgetattr(model, "trainable", False), so a model written before this change is treated as not trainable rather than being assumed retrainable.This matches the field Antenna reads from
/info, which it mirrors onto its ownAlgorithmrecords. The corresponding Antenna change is in RolnickLab/antenna#1407.Verification
trapdata/tests/test_trainable_flag.pycovers the default, the response default, a model that declares the flag, and a model that predates the attribute.Note: these tests have not been run locally — the working tree had no Python environment and building one pulls in torch. The schema field itself was checked in isolation with pydantic. CI runs the rest.