mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 10:02:22 +00:00
Set also scale for embedding to 0.025.
This commit is contained in:
parent
188eada7ac
commit
8cff994cd7
@ -451,8 +451,9 @@ class ScaledEmbedding(nn.Module):
|
|||||||
|
|
||||||
|
|
||||||
def reset_parameters(self) -> None:
|
def reset_parameters(self) -> None:
|
||||||
nn.init.normal_(self.weight, std=0.05)
|
std = 0.025
|
||||||
nn.init.constant_(self.scale, torch.tensor(1.0/0.05).log())
|
nn.init.normal_(self.weight, std=std)
|
||||||
|
nn.init.constant_(self.scale, torch.tensor(1.0/std).log())
|
||||||
|
|
||||||
if self.padding_idx is not None:
|
if self.padding_idx is not None:
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user