mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Tweak formula for widths
This commit is contained in:
parent
6091146e91
commit
fd26b890d2
@ -1019,7 +1019,7 @@ class RelPositionalEncoding(torch.nn.Module):
|
||||
centers[:, 1] *= -1.0
|
||||
centers = centers.reshape(self.embed_dim)
|
||||
|
||||
widths = (centers.abs() * width_factor).clamp(min=1.0)
|
||||
widths = (centers.abs() * width_factor) + 1.0
|
||||
|
||||
# shape: (2*T - 1, embed_dim)
|
||||
pe = ((x - centers) / widths).tanh()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user