nos.metrics package

Submodules

nos.metrics.error_metrics module

class nos.metrics.error_metrics.L1Error

Bases: Loss

L1 error metric (Mean Absolute Error).

class nos.metrics.error_metrics.Loss(name: str, loss)

Bases: Metric

Class for evaluating error metrics.

Parameters:
  • name – The name of the metric.

  • loss – The loss function for calculating the metric.

class nos.metrics.error_metrics.MSError

Bases: Loss

Mean square error metric (L2 Error).

nos.metrics.metric module

class nos.metrics.metric.Metric(name: str)

Bases: ABC

Base class for all metrics.

abstract __call__(operator: Operator, dataset: OperatorDataset) Dict

Evaluates the metric.

Parameters:
  • operator – operator for which the metric is evaluated.

  • dataset – dataset on which the metric is evaluated.

Returns:

dict containing the results of the metric (keys “value” and “unit” should be in the dict).

nos.metrics.operator_metrics module

class nos.metrics.operator_metrics.NumberOfParameters

Bases: Metric

Number of parameters in the operator.

class nos.metrics.operator_metrics.SpeedOfEvaluation

Bases: Metric

Speed of a single evaluation in milliseconds.

Module contents

class nos.metrics.L1Error

Bases: Loss

L1 error metric (Mean Absolute Error).

class nos.metrics.MSError

Bases: Loss

Mean square error metric (L2 Error).

class nos.metrics.Metric(name: str)

Bases: ABC

Base class for all metrics.

abstract __call__(operator: Operator, dataset: OperatorDataset) Dict

Evaluates the metric.

Parameters:
  • operator – operator for which the metric is evaluated.

  • dataset – dataset on which the metric is evaluated.

Returns:

dict containing the results of the metric (keys “value” and “unit” should be in the dict).

class nos.metrics.NumberOfParameters

Bases: Metric

Number of parameters in the operator.

class nos.metrics.SpeedOfEvaluation

Bases: Metric

Speed of a single evaluation in milliseconds.