steps.ultralytics.model.trainer¶
trainer
¶
Functions:
Name | Description |
---|---|
train_ultralytics_model |
Train an Ultralytics model using the provided dataset collection and training context. |
train_ultralytics_model(model, dataset_collection)
¶
Train an Ultralytics model using the provided dataset collection and training context.
This step:
- Retrieves the active training context to access hyperparameters, augmentation settings, and experiment metadata.
- Initializes an UltralyticsModelTrainer
to handle the training logic.
- Runs the training pipeline on the dataset collection.
- Sets the latest run directory and locates the best model weights after training.
- Saves the trained model weights as an artifact in the experiment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
UltralyticsModel
|
The model instance to be trained. |
required |
|
DatasetCollection[TBaseDataset]
|
The dataset collection used for training, typically including 'train', 'val', and optionally 'test' datasets. |
required |
Returns:
Name | Type | Description |
---|---|---|
UltralyticsModel |
UltralyticsModel
|
The trained model with updated internal state and trained weights. |