Skip to content

Commit 78a816a

Browse files
authored
Fix macro accuracy when changing labels (#15379)
* Fix macro accuracy when changing labels Signed-off-by: He Huang (Steve) <105218074+stevehuang52@users.noreply.github.com> * Apply isort and black reformatting Signed-off-by: stevehuang52 <stevehuang52@users.noreply.github.com> --------- Signed-off-by: He Huang (Steve) <105218074+stevehuang52@users.noreply.github.com> Signed-off-by: stevehuang52 <stevehuang52@users.noreply.github.com> Co-authored-by: stevehuang52 <stevehuang52@users.noreply.github.com>
1 parent f055242 commit 78a816a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nemo/collections/asr/models/classification_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@ def change_labels(self, new_labels: List[str]):
701701
if 'test_ds' in self._cfg and self._cfg.test_ds is not None:
702702
self._cfg.test_ds.labels = new_labels
703703

704+
self._macro_accuracy = Accuracy(
705+
num_classes=self.decoder.num_classes, top_k=1, average='macro', task='multiclass'
706+
)
704707
logging.info(f"Changed decoder output to {self.decoder.num_classes} labels.")
705708

706709
@classmethod

0 commit comments

Comments
 (0)