Ultralytics Code Refactor https://ultralytics.com/actions (#16047)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
95d54828bb
commit
ac2c2be8f3
12 changed files with 45 additions and 62 deletions
|
|
@ -18,5 +18,4 @@ class AGLU(nn.Module):
|
|||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
"""Compute the forward pass of the Unified activation function."""
|
||||
lam = torch.clamp(self.lambd, min=0.0001)
|
||||
y = torch.exp((1 / lam) * self.act((self.kappa * x) - torch.log(lam)))
|
||||
return y # for AGLU simply return y * input
|
||||
return torch.exp((1 / lam) * self.act((self.kappa * x) - torch.log(lam)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue