Fine-tuning API#
Registration-time helpers for adapting pretrained models before optimizer construction.
See also
User guide: Fine-Tuning Pretrained Models
Training strategy API: Training strategy API
Training update hooks: Training update hooks
Strategy#
Training strategy for patching modules and selecting trainable parameters. |
|
Start a new fine-tuning run from checkpointed model weights. |
|
Load a restartable strategy checkpoint. |
Use FineTuningStrategy.load_checkpoint(...) to resume an interrupted run
with saved optimizer state, scheduler state, counters, and serialized
fine-tuning configuration. Use FineTuningStrategy.from_pretrained_checkpoint(...)
to start a new fine-tuning run whose model weights are initialized from an
existing checkpoint; optimizer state, hooks, and counters do not carry over.
See Fine-Tuning Pretrained Models for patterns and examples.
Hooks#
Registration-time hooks that adapt the model tree and optimizer parameter set
before training starts. They do not own backward() or optimizer-step
behavior; use Training update hooks for batch-update policies.
Patch model submodules at registration time. |
|
Select which parameters stay trainable during fine-tuning. |
ModulePatchHook
Field |
Type |
Description |
|---|---|---|
|
|
Ordered mapping of target paths to replacement modules or specs that build modules. |
TrainableParameterHook
Field |
Type |
Description |
|---|---|---|
|
|
Glob patterns for parameters to freeze. Overridden by |
|
|
Glob patterns for parameters to keep trainable. On their own they define the full trainable set (everything else is frozen). |
|
|
Whether excluded parameters are temporarily frozen via |