Training strategy API#
Core training-loop classes and helpers.
See also
Fine-tuning guide: Fine-Tuning Pretrained Models
Fine-tuning API: Fine-tuning API
Losses guide: Losses
Training update hooks: Training update hooks
Strategies#
Pydantic-driven supervised training loop for MLIP models. |
|
Run a forward pass and prefix output keys with |
Field |
Type |
Description |
|---|---|---|
|
|
Hooks to run at training stages. Accepts |
|
|
Runtime optimizer-step counter, excluded from specs. Batches whose optimizer step is skipped by update hooks do not advance this counter. |
|
|
Named models visible to |
|
|
Optimizer/scheduler configs keyed by model name. Keys may target a subset of |
|
|
Epoch count; mutually exclusive with |
|
|
Target step count; mutually exclusive with |
|
|
Positive multiplier applied when converting |
|
|
Explicit forward-pass callable. Single-model strategies call |
|
|
Composed loss whose components drive target collection. Leaf losses are accepted and normalized to one-component composed losses. |
|
|
Callable that assembles loss targets from the loss function, training predictions, current batch, and optional workflow. |
|
|
One device shared by all models, or one device per model for helper placement. Named-model |
|
|
Optional external distributed manager. The strategy passes this through hook contexts for distributed-aware hooks. |
|
|
Runtime optimizer-step counter across all data-parallel workers, excluded from specs. This advances by the distributed world size when an optimizer step runs, so checkpoint restarts can recover sampler progress without assuming the same world size. |
|
|
Runtime batch counter, excluded from specs. This advances for every completed batch, including batches whose optimizer step is skipped. |
|
|
Runtime epoch counter, excluded from specs. |
|
|
Runtime counter for batches consumed within the current epoch, excluded from specs. |
|
|
Runtime flag recording whether a single model was supplied (stored under |
|
|
Most recent validation summary dict, or |
|
|
Optional inference-time model (e.g. EMA weights) used in place of the live training model for validation when |
|
|
Validation configuration controlling when and how validation runs. |
Optimizer helpers#
Declarative optimizer and optional LR-scheduler bundle. |
|
Build optimizers and schedulers for configured model names. |
|
Call |
|
Call |
|
Call |
Field |
Type |
Description |
|---|---|---|
|
|
Optimizer class; |
|
|
Keyword arguments forwarded to the optimizer constructor; validated against its |
|
|
Optional LR scheduler. Time-based schedulers ( |
|
|
Must be empty unless |
|
|
How a metric-driven scheduler ( |
Serialization and checkpoints#
Base class for JSON-serializable, no-pickle hyperparameter specs. |
|
Build a |
|
Rebuild a |
|
Register JSON (de)serializers for a custom type. |
|
Unified checkpoint manifest and runtime container. |
|
Save a checkpoint with a manifest. |
|
Load a multi-component checkpoint written by |