From 3590c2fc42fca8b023e4fc5603fa7651e8b77328 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Sun, 31 Jul 2022 18:05:36 +0800 Subject: [PATCH] Set cov_min[1] to 0 to stop an invertibility problem --- egs/librispeech/ASR/pruned_transducer_stateless7/optim.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/optim.py b/egs/librispeech/ASR/pruned_transducer_stateless7/optim.py index ec1ef76f5..5b482c89b 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/optim.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/optim.py @@ -163,7 +163,7 @@ param_rms_smooth1: Smoothing proportion for parameter matrix, if assumed rank of lr=3e-02, betas=(0.9, 0.98), size_lr_scale=0.1, - cov_min=(0.025, 0.0025, 0.02, 0.0001), + cov_min=(0.025, 0.0, 0.02, 0.0001), cov_max=(10.0, 80.0, 5.0, 400.0), cov_pow=(1.0, 1.0, 1.0, 1.0), param_rms_smooth0=0.4, @@ -761,6 +761,7 @@ param_rms_smooth1: Smoothing proportion for parameter matrix, if assumed rank of #G = G.clone() #G_diag = _diag(G) # aliased + #G_diag *= 1.005 # ensure invertible. G = self._smooth_cov(G, group["cov_min"][3], group["cov_max"][3], @@ -884,7 +885,9 @@ param_rms_smooth1: Smoothing proportion for parameter matrix, if assumed rank of # make sure eigs of M^{0.5} X M^{0.5} are average 1. this imposes limit on the max. X /= mean_eig - X += min_eig * M.inverse() + if min_eig != 0.0: + # should be inverting as block-diag.. + X += min_eig * M.inverse() eig_ceil = X.shape[-1]