Skip to main content
← Lab

spectralflip

confirmedupstream bugPython · torchmetricsInference & servingJuly 24, 2026

the question

Does torchmetrics' SpectralDistortionIndex declare the correct higher_is_better direction?

what came out

torchmetrics' SpectralDistortionIndex (D_lambda) is a distortion metric minimized at 0 but declares higher_is_better=True, so MetricTracker selects the most spectrally distorted epoch. The sibling SpatialDistortionIndex declares False and the package's own QNR formula (1-d_lambda)^alpha confirms lower is better.

method & receipts

  • Result: confirmed
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/spectralflip