mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 01:52:41 +00:00
Replace norm on input layer with scale of 0.1.
This commit is contained in:
parent
a37d98463a
commit
e2ace9d545
@ -58,7 +58,6 @@ class Conv2dSubsampling(nn.Module):
|
|||||||
ExpScaleRelu(odim, 1, 1, speed=20.0),
|
ExpScaleRelu(odim, 1, 1, speed=20.0),
|
||||||
)
|
)
|
||||||
self.out = nn.Linear(odim * (((idim - 1) // 2 - 1) // 2), odim)
|
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:
|
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||||
"""Subsample x.
|
"""Subsample x.
|
||||||
@ -77,7 +76,7 @@ class Conv2dSubsampling(nn.Module):
|
|||||||
b, c, t, f = x.size()
|
b, c, t, f = x.size()
|
||||||
x = self.out(x.transpose(1, 2).contiguous().view(b, t, c * f))
|
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)
|
# Now x is of shape (N, ((T-1)//2 - 1))//2, odim)
|
||||||
x = self.out_norm(x)
|
x = x * 0.1
|
||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ def get_parser():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--exp-dir",
|
"--exp-dir",
|
||||||
type=str,
|
type=str,
|
||||||
default="transducer_stateless/specaugmod_baseline_randcombine1_expscale3_brelu2swish2",
|
default="transducer_stateless/specaugmod_baseline_randcombine1_expscale3_brelu2swish2_0.1",
|
||||||
help="""The experiment dir.
|
help="""The experiment dir.
|
||||||
It specifies the directory where all training related
|
It specifies the directory where all training related
|
||||||
files, e.g., checkpoints, log, etc, are saved
|
files, e.g., checkpoints, log, etc, are saved
|
||||||
|
Loading…
x
Reference in New Issue
Block a user