From e2ace9d5457139dbc5a8092c9cc6afffab633857 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Mon, 7 Mar 2022 11:24:04 +0800 Subject: [PATCH] Replace norm on input layer with scale of 0.1. --- egs/librispeech/ASR/conformer_ctc/subsampling.py | 3 +-- egs/librispeech/ASR/transducer_stateless/train.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc/subsampling.py b/egs/librispeech/ASR/conformer_ctc/subsampling.py index 1fe1265fa..2df2678dd 100644 --- a/egs/librispeech/ASR/conformer_ctc/subsampling.py +++ b/egs/librispeech/ASR/conformer_ctc/subsampling.py @@ -58,7 +58,6 @@ class Conv2dSubsampling(nn.Module): ExpScaleRelu(odim, 1, 1, speed=20.0), ) self.out = nn.Linear(odim * (((idim - 1) // 2 - 1) // 2), odim) - self.out_norm = nn.LayerNorm(odim, elementwise_affine=False) def forward(self, x: torch.Tensor) -> torch.Tensor: """Subsample x. @@ -77,7 +76,7 @@ class Conv2dSubsampling(nn.Module): b, c, t, f = x.size() x = self.out(x.transpose(1, 2).contiguous().view(b, t, c * f)) # Now x is of shape (N, ((T-1)//2 - 1))//2, odim) - x = self.out_norm(x) + x = x * 0.1 return x diff --git a/egs/librispeech/ASR/transducer_stateless/train.py b/egs/librispeech/ASR/transducer_stateless/train.py index 16746147f..0dbd8479b 100755 --- a/egs/librispeech/ASR/transducer_stateless/train.py +++ b/egs/librispeech/ASR/transducer_stateless/train.py @@ -110,7 +110,7 @@ def get_parser(): parser.add_argument( "--exp-dir", type=str, - default="transducer_stateless/specaugmod_baseline_randcombine1_expscale3_brelu2swish2", + default="transducer_stateless/specaugmod_baseline_randcombine1_expscale3_brelu2swish2_0.1", help="""The experiment dir. It specifies the directory where all training related files, e.g., checkpoints, log, etc, are saved