We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
SigmoidTransform
1 parent f8cab38 commit c5d5d45Copy full SHA for c5d5d45
torch/distributions/transforms.py
@@ -3,6 +3,7 @@
3
import weakref
4
5
import torch
6
+import torch.nn.functional as F
7
from torch.distributions import constraints
8
from torch.distributions.utils import (_sum_rightmost, broadcast_all,
9
lazy_property)
@@ -359,7 +360,7 @@ def _inverse(self, y):
359
360
return y.log() - (-y).log1p()
361
362
def log_abs_det_jacobian(self, x, y):
- return -(y.reciprocal() + (1 - y).reciprocal()).log()
363
+ return -F.softplus(-x) - F.softplus(x)
364
365
366
class AbsTransform(Transform):
0 commit comments