mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-08 17:42:21 +00:00
init 1st conv module to smaller variance
This commit is contained in:
parent
bcf417fce2
commit
bec33e6855
@ -59,6 +59,14 @@ class Conv2dSubsampling(nn.Module):
|
||||
)
|
||||
self.out = nn.Linear(odim * (((idim - 1) // 2 - 1) // 2), odim)
|
||||
self.out_norm = BasicNorm(odim)
|
||||
self._reset_parameters()
|
||||
|
||||
def _reset_parameters(self):
|
||||
# init weights with smaller than default variance, because otherwise
|
||||
# they learn too slowly in relative terms (assuming we're training with adam).
|
||||
nn.init.normal_(self.conv[0].weight, std=0.05)
|
||||
nn.init.constant_(self.conv[0].bias, 0.0)
|
||||
|
||||
|
||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
"""Subsample x.
|
||||
|
@ -110,7 +110,7 @@ def get_parser():
|
||||
parser.add_argument(
|
||||
"--exp-dir",
|
||||
type=str,
|
||||
default="transducer_stateless/specaugmod_baseline_randcombine1_expscale3_brelu2swish2_0.1_bnorm2ma0.5_pbs",
|
||||
default="transducer_stateless/randcombine1_expscale3_brelu2swish2_0.1_bnorm2ma0.5_pbs_cinit",
|
||||
help="""The experiment dir.
|
||||
It specifies the directory where all training related
|
||||
files, e.g., checkpoints, log, etc, are saved
|
||||
|
Loading…
x
Reference in New Issue
Block a user