tempo_acc1

MIREX Accuracy 1: octave-tolerant tempo accuracy.

Functions

tempo_acc1(pred, target[, tolerance, factors])

MIREX Accuracy 1: fraction of predictions within tolerance of any octave-equivalent tempo.

tempo_acc1(pred, target, tolerance=0.08, factors=(0.5, 1.0, 2.0))[source]

MIREX Accuracy 1: fraction of predictions within tolerance of any octave-equivalent tempo.

A prediction is correct if it is within tolerance × factor × target for any factor in factors. The default 8% tolerance matches the MIREX evaluation standard.

Parameters:
  • pred (Tensor) – Predicted BPM values, shape (B,).

  • target (Tensor) – Ground-truth BPM values, shape (B,).

  • tolerance (float) – Relative tolerance (default: 0.08 → ±8%).

  • factors (tuple) – Metrical multiples to consider (default: 0.5×, 1×, 2×).

Returns:

Fraction of correct predictions in [0, 1], shape ().

Return type:

Tensor