|
|
|
@ -35,21 +35,21 @@ class Softplus(Bijector):
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> # To initialize a Softplus bijector of sharpness 2.
|
|
|
|
|
>>> softplus = nn.probability.bijector.Softfplus(2)
|
|
|
|
|
>>> softplus = nn.probability.bijector.Softplus(2)
|
|
|
|
|
>>>
|
|
|
|
|
>>> # To use ScalarAffine bijector in a network.
|
|
|
|
|
>>> class net(Cell):
|
|
|
|
|
>>> def __init__(self):
|
|
|
|
|
>>> super(net, self).__init__():
|
|
|
|
|
>>> self.sp1 = nn.probability.bijector.Softflus(2)
|
|
|
|
|
>>>
|
|
|
|
|
>>> def construct(self, value):
|
|
|
|
|
>>> # Similar calls can be made to other functions
|
|
|
|
|
>>> # by replacing 'forward' by the name of the function.
|
|
|
|
|
>>> ans1 = self.sp1.forward(value)
|
|
|
|
|
>>> ans2 = self.sp1.inverse(value)
|
|
|
|
|
>>> ans3 = self.sp1.forward_log_jacobian(value)
|
|
|
|
|
>>> ans4 = self.sp1.inverse_log_jacobian(value)
|
|
|
|
|
... def __init__(self):
|
|
|
|
|
... super(net, self).__init__():
|
|
|
|
|
... self.sp1 = nn.probability.bijector.Softplus(2.)
|
|
|
|
|
...
|
|
|
|
|
... def construct(self, value):
|
|
|
|
|
... # Similar calls can be made to other functions
|
|
|
|
|
... # by replacing 'forward' by the name of the function.
|
|
|
|
|
... ans1 = self.sp1.forward(value)
|
|
|
|
|
... ans2 = self.sp1.inverse(value)
|
|
|
|
|
... ans3 = self.sp1.forward_log_jacobian(value)
|
|
|
|
|
... ans4 = self.sp1.inverse_log_jacobian(value)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def __init__(self,
|
|
|
|
|