luz.metrics module

class Accuracy

Bases: luz.metrics.Metric

compute()

Compute metric.

Return type

float

reset()

Compute on epoch start.

Return type

None

update(output, target, **kwargs)

Compute on batch end.

Parameters
  • output (Tensor) – Output tensor. Shape: \((N,C)\)

  • target (Tensor) – Target tensor. One-hot encoded. Shape: \((N,C)\)

Return type

None

class DurbinWatson

Bases: luz.metrics.Metric

compute()

Compute metric.

Return type

float

reset()

Reset metric state.

Return type

None

update(output, target, **kwargs)

Update metric state.

Return type

None

class FBeta(beta)

Bases: luz.metrics.Metric

compute()

Compute metric.

Return type

float

reset(**kwargs)

Reset metric state.

Return type

None

update(output, target, **kwargs)

Compute on batch end.

Parameters
  • output (Tensor) – Output tensor. Shape: \((N,2)\)

  • target (Tensor) – Target tensor. One-hot encoded. Shape: \((N,2)\)

Return type

None

class Max(batch_dim=0)

Bases: luz.metrics.Metric

compute()

Compute metric.

reset()

Reset metric state.

Return type

None

update(x, **kwargs)

Update metric state.

Return type

None

class MeanStd(batch_dim=0)

Bases: luz.metrics.Metric

compute()

Compute metric.

reset()

Reset metric state.

Return type

None

update(x, **kwargs)

Update metric state.

Return type

None

class Metric

Bases: abc.ABC

abstract compute()

Compute metric.

abstract reset()

Reset metric state.

Return type

None

abstract update(**kwargs)

Update metric state.

Return type

None

class Min(batch_dim=0)

Bases: luz.metrics.Metric

compute()

Compute metric.

reset()

Reset metric state.

Return type

None

update(x, **kwargs)

Update metric state.

Return type

None