mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Multiply length_factor by 2.0.
This commit is contained in:
parent
e9806950f5
commit
d23fda7c5f
@ -937,7 +937,10 @@ class CompactRelPositionalEncoding(torch.nn.Module):
|
||||
# length_factor is chosen so that the FFT can exactly separate points
|
||||
# close to the origin (T == 0). So this part of the formulation is not really
|
||||
# heuristic.
|
||||
length_factor = self.embed_dim / (2.0 * math.pi) # todo: test this.
|
||||
length_factor = self.embed_dim / (2.0 * math.pi)
|
||||
# multiplying length_factor by this heuristic constant should reduce the resolution near to the
|
||||
# origin, i.e. reduce its ability to separate points near zero.
|
||||
length_factor *= 2.0
|
||||
|
||||
# note for machine implementations: if atan is not available, we can use:
|
||||
# x.sign() * ((1 / (x.abs() + 1)) - 1) * (-math.pi/2)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user