biapy.engine
BiaPy engine package.
This package contains core workflow classes, training and evaluation engines, metrics, and learning rate schedulers for deep learning pipelines in BiaPy.
- biapy.engine.prepare_optimizer(cfg: CfgNode, model_without_ddp: Module | DistributedDataParallel, steps_per_epoch: int) Tuple[Optimizer, ReduceLROnPlateau | WarmUpCosineDecayScheduler | OneCycleLR | None][source]
Create and configure the optimizer and learning rate scheduler for the given model.
This function selects and initializes the optimizer (e.g., Adam, AdamW) and, if specified, the learning rate scheduler (ReduceLROnPlateau, WarmUpCosineDecayScheduler, or OneCycleLR) based on the configuration.
- Parameters:
cfg (YACS CN object) – Configuration object with optimizer and scheduler settings.
model_without_ddp (nn.Module or nn.parallel.DistributedDataParallel) – The model to optimize.
steps_per_epoch (int) – Number of steps (batches) per training epoch.
- Returns:
optimizer (Optimizer) – Configured optimizer for the model.
lr_scheduler (Scheduler or None) – Configured learning rate scheduler, or None if not specified.
- biapy.engine.build_callbacks(cfg: CfgNode) EarlyStopping | None[source]
Create training and validation generators.
- Parameters:
cfg (YACS CN object) – Configuration.
- Returns:
callbacks – All callbacks to be applied to a model.
- Return type:
List of callbacks
Submodules
Module |
Description |
|---|---|
Base workflow class that provides the main structure and utility methods for building training and inference workflows in BiaPy. |
|
Configuration checking utilities for BiaPy. |
|
Engine for image classification workflows. |
|
Engine for image denoising workflows. |
|
Engine for object detection workflows. |
|
Engine for instance segmentation workflows. |
|
Metrics and evaluation utilities for model training and validation. |
|
Learning rate schedulers and related utilities. |
|
Warmup cosine decay learning rate scheduler. |
|
Engines for self-supervised learning workflows (pre-training). |
|
Engine for semantic segmentation workflows. |
|
Engine for single image super-resolution workflows. |
|
Training and evaluation engine for BiaPy. |