mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Subtract, not add, 0.025.
This commit is contained in:
parent
9a71406a46
commit
d260b54177
@ -1119,7 +1119,7 @@ class DoubleSwishFunction(torch.autograd.Function):
|
||||
d_int = d_scaled.to(torch.uint8)
|
||||
ctx.save_for_backward(d_int)
|
||||
# on wolframalpha, do: (x * sigmoid(x-1) - 0.05 * x + 0.05 * min(0.15, max(-0.15, x)) + 0.025) from x=-3 to 2
|
||||
y = y + alpha * x + beta * x.clamp(min=-x_limit, max=x_limit) + 0.025
|
||||
y = y + alpha * x + beta * x.clamp(min=-x_limit, max=x_limit) - 0.025
|
||||
if x.dtype == torch.float16 or torch.is_autocast_enabled():
|
||||
y = y.to(torch.float16)
|
||||
return y
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user