mindspore.nn.probability.bijector.Exp
- class mindspore.nn.probability.bijector.Exp(name='Exp')[source]
Exponential Bijector. This Bijector performs the operation:
\[Y = \exp(x).\]- Parameters
name (str) – The name of the Bijector. Default: ‘Exp’.
- Inputs and Outputs of APIs:
The accessible apis of the Exp bijector are defined in the base class, including:
forward
inverse
forward_log_jacobian
inverse_log_jacobian
It should be notice that the inputs to the APIs of the Exp bijector should be always a tensor. For more details of all APIs, including the inputs and outputs of the APIs of the Exp bijector, please refer to
mindspore.nn.probability.bijector.Bijector
, and examples below.- Supported Platforms:
Ascend
GPU
Examples
>>> import mindspore >>> import mindspore.nn as nn >>> from mindspore import Tensor >>> >>> # To initialize an Exp bijector. >>> exp_bijector = nn.probability.bijector.Exp() >>> value = Tensor([1, 2, 3], dtype=mindspore.float32) >>> ans1 = exp_bijector.forward(value) >>> print(ans1.shape) (3,) >>> ans2 = exp_bijector.inverse(value) >>> print(ans2.shape) (3,) >>> ans3 = exp_bijector.forward_log_jacobian(value) >>> print(ans3.shape) (3,) >>> ans4 = exp_bijector.inverse_log_jacobian(value) >>> print(ans4.shape) (3,)
- forward(value)
forward mapping, compute the value after mapping as \(Y = \exp(X)\).
Parameters
value (Tensor) - the value to compute.
Returns
Tensor, the value of output after mapping.
- forward_log_jacobian(value)
compute the log value after mapping, namely \(\log(d\exp(x) / dx)\).
Parameters
value (Tensor) - the value to compute.
Returns
Tensor, the log value of forward mapping.
- inverse(value)
Inverse mapping, compute the value after inverse mapping as \(X = \log(Y)\).
Parameters
value (Tensor) - the value of output after mapping.
Returns
Tensor, the value to compute.
- inverse_log_jacobian(value)
Compute the log value of the inverse mapping, namely \(\log(d\log(x) / dx)\).
Parameters
value (Tensor) - the value of output after mapping.
Returns
Tensor, the log value of the inverse mapping.