From 0df406c5da5dfeca9721ccfb26f5164c626ee4b2 Mon Sep 17 00:00:00 2001 From: Zengwei Yao Date: Mon, 20 May 2024 22:32:02 +0800 Subject: [PATCH] Initialize BiasNorm bias with small random values (#1630) --- egs/librispeech/ASR/zipformer/scaling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/librispeech/ASR/zipformer/scaling.py b/egs/librispeech/ASR/zipformer/scaling.py index 29ac33c02b..fb2bf1b79f 100644 --- a/egs/librispeech/ASR/zipformer/scaling.py +++ b/egs/librispeech/ASR/zipformer/scaling.py @@ -462,7 +462,7 @@ def __init__( self.num_channels = num_channels self.channel_dim = channel_dim self.log_scale = nn.Parameter(torch.tensor(log_scale)) - self.bias = nn.Parameter(torch.zeros(num_channels)) + self.bias = nn.Parameter(torch.empty(num_channels).normal_(mean=0, std=1e-4)) self.log_scale_min = log_scale_min self.log_scale_max = log_scale_max