From 76e66408c51286214345799b6fe53667707344f4 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Tue, 27 Sep 2022 11:08:44 +0800 Subject: [PATCH] Some cosmetic improvements --- egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py | 2 +- icefall/diagnostics.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py b/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py index 374a260e5..05bf4fb65 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/scaling.py @@ -179,7 +179,7 @@ class MaxEigLimiterFunction(torch.autograd.Function): ans_direction = ans_direction / ans_direction.norm() if random.random() < 0.001: - logging.info(f"variance_proportion = {variance_proportion.item()}") + logging.info(f"variance_proportion = {variance_proportion.item()}, shape={tuple(x.shape)}") # Caution: this causes a CUDA sync, which is not ideal. if variance_proportion >= max_variance_proportion: diff --git a/icefall/diagnostics.py b/icefall/diagnostics.py index 445500206..7807ad5e6 100644 --- a/icefall/diagnostics.py +++ b/icefall/diagnostics.py @@ -240,7 +240,7 @@ class TensorDiagnostic(object): ans = stats.tolist() ans = ["%.2g" % x for x in ans] ans = "[" + " ".join(ans) + "]" - if stats_type == "value": + if stats_type in [ "value", "rms", "eigs" ]: # This norm is useful because it is strictly less than the largest # sqrt(eigenvalue) of the variance, which we print out, and shows, # speaking in an approximate way, how much of that largest eigenvalue