frameworks.ultralytics.services.model.logger.classification¶
classification
¶
Classes:
Name | Description |
---|---|
UltralyticsClassificationMetricMapping |
Defines the metric mapping for classification tasks in the Ultralytics framework. |
UltralyticsClassificationLogger |
Logger for Ultralytics-based classification models. |
UltralyticsClassificationMetricMapping()
¶
Bases: UltralyticsBaseMetricMapping
Defines the metric mapping for classification tasks in the Ultralytics framework.
This class extends the base Ultralytics metric mapping and adds classification-specific metrics such as top-1 and top-5 accuracy and loss for both training and validation phases.
Registers classification metrics including loss, top-1 accuracy, and top-5 accuracy for both training and validation.
Methods:
Name | Description |
---|---|
add_metric |
Add a metric to the specified phase. |
get_mapping |
Get mapping of framework names to standard names for a given phase. |
Attributes:
Name | Type | Description |
---|---|---|
mappings |
dict[str, list[Metric]]
|
|
UltralyticsClassificationLogger(experiment, metric_mapping)
¶
Bases: BaseLogger
Logger for Ultralytics-based classification models.
This class is responsible for logging classification-related metrics during training and validation, using an Ultralytics-compatible metric mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Experiment
|
The experiment object used for logging. |
required |
|
ClassificationMetricMapping
|
The metric mapping used to normalize metric names. |
required |
Methods:
Name | Description |
---|---|
log_metric |
Log a metric value (e.g. for line plot). |
log_value |
Log a scalar value (e.g., accuracy score). |
log_image |
Log an image file. |
log_confusion_matrix |
Log a confusion matrix as a heatmap. |
log_table |
Log a table (either a key-value dict or 2D matrix). |
get_log_name |
Construct log name with optional phase and mapped name. |
Attributes:
Name | Type | Description |
---|---|---|
experiment |
|
|
metric_mapping |
|