Configuration
SUMMARY
Iris uses typed constructors for the shared Trainer, model-family configuration, and post-processing behavior. Export and deployment options are documented with their workflow.
Trainer Reference
Constructor Options
| Option | Default | Description |
|---|---|---|
model | required | Iris TrainableModel |
training_dataset | required | Dataset used for optimization |
output_dir | required | Directory for checkpoints and training outputs |
validation_dataset | None | Optional dataset used for validation and evaluation |
optimizer | None | Custom optimizer; defaults to AdamW |
scheduler | None | Optional learning-rate scheduler |
epochs | 10 | Total epoch count, including restored epochs |
batch_size | 4 | Samples per batch |
learning_rate | 1e-4 | Learning rate for the default optimizer |
weight_decay | 1e-4 | Weight decay for the default optimizer |
device | None | Explicit device; automatically selects CUDA when available |
num_workers | 0 | DataLoader worker count |
gradient_clip_norm | 0.1 | Maximum gradient norm; None disables clipping |
mixed_precision | True | Enables automatic mixed precision on CUDA |
evaluation_interval | 1 | Epochs between validation runs |
checkpoint_interval | 1 | Epochs between numbered checkpoints |
seed | 42 | Python, NumPy, and PyTorch random seed |
metric_logger | None | Optional TensorBoardMetricLogger |
on_epoch_end | None | Callback invoked after every epoch |
Methods
| Method | Returns | Description |
|---|---|---|
trainer.train(resume_from=None) | list[dict[str, float]] | Runs training and validation and returns metric history |
trainer.evaluate(dataset=None) | dict[str, float] | Evaluates a supplied dataset or the configured validation dataset |
trainer.resume(checkpoint_path) | list[dict[str, float]] | Restores a checkpoint and continues to the configured total epochs |
trainer.save_checkpoint(checkpoint_path, epoch=...) | None | Saves model, optimizer, scheduler, scaler, history, and progress |
trainer.load_checkpoint(checkpoint_path) | None | Restores saved training state and advances the starting epoch |
See Train RFDETR for Trainer settings, Export a Model for export options, and Run Inference for inference and post-processing options.