Skip to content
GitHub

sparx.metrics

Metrics over a spiking objective’s evaluation, which dew’s Trainer.fit(metrics=...) takes.

Accuracy reports under accuracy, so a run logs val/accuracy (or <split>/accuracy), and a run’s record names it by import path, sparx.metrics:Accuracy.

Name
AccuracyThe share of examples whose predicted class is their label, over a whole pass.
class Accuracy

sparx.metrics on GitHub

The share of examples whose predicted class is their label, over a whole pass.

It reads the TokenScores that SpikingClassifierObjective.evaluate returns, one row per example, each counted by its weight. Dew’s validation pass hands a metric the real rows alone, so the repeats that fill a split’s last batch count for nothing.

def __call__(scores: Artifact, batch: Batch) -> tuple[float, float]
def finalize(accumulated: tuple[float, float]) -> float