ed.transform
优质
小牛编辑
132浏览
2023-12-01
Aliases:
ed.transform
ed.util.transform
transform(
x,
*args,
**kwargs
)
Defined in edward/util/random_variables.py
.
Transform a continuous random variable to the unconstrained space.
transform
selects among a number of default transformations which depend on the support of the provided random variable:
- $([0, 1])$ (e.g., Beta): Inverse of sigmoid.
- $([0, \infty))$ (e.g., Gamma): Inverse of softplus.
- Simplex (e.g., Dirichlet): Inverse of softmax-centered.
- $((-\infty, \infty))$ (e.g., Normal, MultivariateNormalTriL): None.
Args:
x
: RandomVariable. Continuous random variable to transform. *args, **kwargs: Arguments to overwrite when forming theTransformedDistribution
. For example, manually specify the transformation by passing in thebijector
argument.
Returns:
RandomVariable. A TransformedDistribution
random variable, or the provided random variable if no transformation was applied.
Examples
x = Gamma(1.0, 1.0)
y = ed.transform(x)
sess = tf.Session()
sess.run(y)
-2.2279539