当前位置: 首页 > 文档资料 > Edward 中文文档 >

ed.transform

优质
小牛编辑
128浏览
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 the TransformedDistribution. For example, manually specify the transformation by passing in the bijector 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