Skip to content

Commit

Permalink
ShiftedSoftplus
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogeiger committed Aug 8, 2019
1 parent be8e12c commit 284f27c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion se3cnn/non_linearities/rescaled_act.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ def __call__(self, x):
class ShiftedSoftplus:
def __init__(self, beta):
x = torch.randn(100000, dtype=torch.float64)
self.factor = torch.nn.functional.softplus(x, beta).pow(2).mean().rsqrt().item()
self.shift = torch.nn.functional.softplus(torch.zeros(()), beta).item()
y = torch.nn.functional.softplus(x, beta).sub(self.shift)
self.factor = y.pow(2).mean().rsqrt().item()
self.beta = beta

def __call__(self, x):
Expand Down

0 comments on commit 284f27c

Please sign in to comment.