Skip to content

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 ​

OptionDefaultDescription
modelrequiredIris TrainableModel
training_datasetrequiredDataset used for optimization
output_dirrequiredDirectory for checkpoints and training outputs
validation_datasetNoneOptional dataset used for validation and evaluation
optimizerNoneCustom optimizer; defaults to AdamW
schedulerNoneOptional learning-rate scheduler
epochs10Total epoch count, including restored epochs
batch_size4Samples per batch
learning_rate1e-4Learning rate for the default optimizer
weight_decay1e-4Weight decay for the default optimizer
deviceNoneExplicit device; automatically selects CUDA when available
num_workers0DataLoader worker count
gradient_clip_norm0.1Maximum gradient norm; None disables clipping
mixed_precisionTrueEnables automatic mixed precision on CUDA
evaluation_interval1Epochs between validation runs
checkpoint_interval1Epochs between numbered checkpoints
seed42Python, NumPy, and PyTorch random seed
metric_loggerNoneOptional TensorBoardMetricLogger
on_epoch_endNoneCallback invoked after every epoch

Methods ​

MethodReturnsDescription
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=...)NoneSaves model, optimizer, scheduler, scaler, history, and progress
trainer.load_checkpoint(checkpoint_path)NoneRestores 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.