Skip to content

metric

Metrics to use for training or explanations.

Metric #

Represents a metric for the explainable model.

TorchMetric #

Represent a metric to be used in the training or evaluation process for the whole model (global metric).

Parameters:

Name Type Description Default
metric

The torchmetrics metric to use, as partial.

required
display_metric_type

If set, overrides the default metric name in XpViz.

required
on_raw_data

If set, value are compute from raw data and not preprocessed data (inputs or targets).

required

metric: partial[torchmetrics.metric.Metric] #

display_metric_type: str | None = None #

on_raw_data: bool = False #

TorchLeafMetric #

Represent a metric to be used during the training or the evaluation process, per leaf.

Parameters:

Name Type Description Default
metric

The torchmetrics metric to use, as partial.

required
display_metric_type

If set, overrides the default metric name in XpViz.

required
on_raw_data

If set, value are compute from raw data and not preprocessed data (inputs or targets).

required

metric: partial[torchmetrics.metric.Metric] #

display_metric_type: str | None = None #

on_raw_data: bool = False #

DictMetrics #

Dictionary of metrics (torch eval etc...) used in training or explain stage.

Each metric will be computed globally (for the whole model) and per leaf. In the training stage, help to monitor the training. In the explain stage, allow to visualize metrics in xpdeep-viz along with explanations.