From 1e3d264b4699ef8a6524934331f0b0efcee75f92 Mon Sep 17 00:00:00 2001 From: qweasdzxcvde <35418904+qweasdzxcvde@users.noreply.github.com> Date: Mon, 8 Sep 2025 14:29:57 +0800 Subject: [PATCH] add tot_score inf mask to make training stable I find there are some inf in tot_score, it makes model cannot converge, add inf mask can make training more stable. --- icefall/mmi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/icefall/mmi.py b/icefall/mmi.py index b7777b434..2de8f1aae 100644 --- a/icefall/mmi.py +++ b/icefall/mmi.py @@ -124,6 +124,7 @@ def _compute_mmi_loss_exact_non_optimized( den_tot_scores = den_lats.get_tot_scores(log_semiring=True, use_double_scores=True) tot_scores = num_tot_scores - den_scale * den_tot_scores + tot_scores = tot_scores.masked_fill(torch.isinf(tot_scores), 0.0) loss = -1 * tot_scores.sum() return loss