espnet3.systems.esp2_enh.metrics.sisnr.MeanScore
espnet3.systems.esp2_enh.metrics.sisnr.MeanScore
class espnet3.systems.esp2_enh.metrics.sisnr.MeanScore
Bases: BaseMetric
Average a per-utterance score of ref and hyp over a test set.
ref is the clean speech and hyp the enhanced speech. A subclass implements score() and declares the one output it returns.
Register the running total and count of scored utterances.
compute() → Dict[str, float]
Return the mean score, rounded to 4 places.
- Raises:ValueError – If no utterance was scored.
inputs : ClassVar[Tuple[Field, ...]] = (Field(name='ref', kind='audio', label='Ref', optional=False, channels=None), Field(name='hyp', kind='audio', label='Hyp', optional=False, channels=None))
one Field per SCP input. The name is the key of data (and the default SCP file name); the kind says what the SCP values hold (text: the value itself, audio: a path). A class attribute for a fixed contract; set on self instead, before calling super().__init__(), for one built from the instance’s own configuration.
- Type: What this metric reads
score(reference: ndarray, estimate: ndarray) → float
Return the score of one utterance.
update(, ref: Sequence[Any], hyp: Sequence[Any]) → None
Add the scores of one batch of utterances.
