From 1826648dde6e9473384f49ea1f6ca5e175aa43e9 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Tue, 22 Nov 2022 22:54:05 +0800 Subject: [PATCH] Fix formulas and constants --- .../ASR/pruned_transducer_stateless7/zipformer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py index 9247171a1..5fb643f32 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7/zipformer.py @@ -465,8 +465,10 @@ class ZipformerEncoderLayer(nn.Module): src_orig = src momentum_alpha = 0.66 - # the -0.5 below is "how strong" to make the negative momentum. - momentum_rate = -0.5 * (1.0 / (1 - momentum_alpha)) + # the -0.333 below is "how strong" to make the negative momentum. + # the (1-momentum_alpha) cancels out the 1/(1-momentum_alpha) factor from + # adding up powers of momentum_alpha + momentum_rate = -0.333 * (1 - momentum_alpha) momentum = 0.0