Skip to content

multiclass_metrics

MulticlassConfusionMatrix that support logit.

Classes:

Name Description
MulticlassConfusionMatrix

MulticlassConfusionMatrix with one hot target support.

MulticlassAccuracy

MulticlassAccuracy with one hot target support.

MulticlassF1Score

MulticlassConfusionMatrix with one hot target support.

MulticlassConfusionMatrix #

MulticlassConfusionMatrix with one hot target support.

Methods:

Name Description
update

Update the metric.

Attributes:

Name Type Description
__module__

__module__ = 'xpdeep_utils.train.metrics_zoo.classification.confusion_matrix' #

update(preds: Tensor, target: Tensor) -> None #

Update the metric.

Source code in src/xpdeep/metrics/zoo/multiclass_metrics.py
def update(self, preds: Tensor, target: Tensor) -> None:
    """Update the metric."""
    target = torch.argmax(target, dim=1)
    super().update(preds, target)

MulticlassAccuracy #

MulticlassAccuracy with one hot target support.

Methods:

Name Description
update

Update the metric.

Attributes:

Name Type Description
__module__

__module__ = 'xpdeep_utils.train.metrics_zoo.classification.multi_class_accuracy' #

update(preds: Tensor, target: Tensor) -> None #

Update the metric.

Source code in src/xpdeep/metrics/zoo/multiclass_metrics.py
def update(self, preds: Tensor, target: Tensor) -> None:
    """Update the metric."""
    target = torch.argmax(target, dim=1)
    super().update(preds, target)

MulticlassF1Score #

MulticlassConfusionMatrix with one hot target support.

Methods:

Name Description
update

Update the metric.

Attributes:

Name Type Description
__module__

__module__ = 'xpdeep_utils.train.metrics_zoo.classification.f1_score' #

update(preds: Tensor, target: Tensor) -> None #

Update the metric.

Source code in src/xpdeep/metrics/zoo/multiclass_metrics.py
def update(self, preds: Tensor, target: Tensor) -> None:
    """Update the metric."""
    target = torch.argmax(target, dim=1)
    super().update(preds, target)