From 6561743d7b454111582011936beb0aa09f8fa161 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Wed, 16 Mar 2022 14:55:17 +0800 Subject: [PATCH] bug fix re sqrt --- egs/librispeech/ASR/conformer_ctc/subsampling.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc/subsampling.py b/egs/librispeech/ASR/conformer_ctc/subsampling.py index 6cc90c8a1..7c7d0ee6c 100644 --- a/egs/librispeech/ASR/conformer_ctc/subsampling.py +++ b/egs/librispeech/ASR/conformer_ctc/subsampling.py @@ -442,7 +442,7 @@ class ScaledLinear(nn.Linear): def _reset_parameters(self): std = 0.05 - a = math.sqrt(3) * std + a = (3 ** 0.5) * std nn.init.uniform_(self.weight, -a, a) if self.bias is not None: nn.init.constant_(self.bias, 0.0) @@ -478,7 +478,7 @@ class ScaledConv1d(nn.Conv1d): def _reset_parameters(self): std = 0.05 - a = math.sqrt(3) * std + a = (3 ** 0.5) * std nn.init.uniform_(self.weight, -a, a) if self.bias is not None: nn.init.constant_(self.bias, 0.0) @@ -520,7 +520,7 @@ class ScaledConv2d(nn.Conv2d): def _reset_parameters(self): std = 0.05 - a = math.sqrt(3) * std + a = (3 ** 0.5) * std nn.init.uniform_(self.weight, -a, a) if self.bias is not None: nn.init.constant_(self.bias, 0.0)