tfp.experimental.tangent_spaces.GeneralSpace

Arbitrary tangent space when no more-efficient special case applies.

Inherits From: TangentSpace

basis Basis object representing a basis of shape [N, B1, ..., Bk, D1, ... Dl], where N is the number of bases vectors, Bi are batch dimensions and Di refer to the dimensions that this basis lives in.
computed_log_volume Optional Tensor of shape [B1, ..., Bk]. Computed log-volume coefficient. Default None.

Methods

transform_coordinatewise

View source

Same as transform_dimension_preserving, for a coordinatewise f.

Default falls back to transform_dimension_preserving, which may be overridden in subclasses.

Args
x same as in transform_dimension_preserving.
f same as in transform_dimension_preserving.
**kwargs same as in transform_dimension_preserving.

Returns
log_density A Tensor representing the log density correction of f at x
space A TangentSpace representing the tangent to fM at f(x)

Raises
NotImplementedError if the TangentSpace subclass does not implement transform_dimension_preserving.

transform_dimension_preserving

View source

Same as transform_general, assuming f goes from R^n to R^n.

Default falls back to transform_general, which may be overridden in subclasses.

Args
x same as in transform_general.
f same as in transform_general.
**kwargs same as in transform_general.

Returns
log_density A Tensor representing the log density correction of f at x
space A TangentSpace representing the tangent to fM at f(x)

Raises
NotImplementedError if the TangentSpace subclass does not implement transform_general.

transform_general

View source

Returns the density correction, in log space, corresponding to f at x.

Also returns a new TangentSpace representing the tangent to fM at f(x).

Args
x Tensor (structure). The point at which to calculate the density.
f Bijector or one of its subclasses. The transformation that requires a density correction based on this tangent space.
**kwargs Optional keyword arguments as part of the Bijector.

Returns
log_density A Tensor representing the log density correction of f at x
space A TangentSpace representing the tangent to fM at f(x)

Raises
NotImplementedError if the TangentSpace subclass does not implement this method.

transform_projection

View source

Same as transform_general, with f a projection (or its inverse).

Default falls back to transform_general, which may be overridden in subclasses.

Args
x same as in transform_general.
f same as in transform_general.
**kwargs same as in transform_general.

Returns
log_density A Tensor representing the log density correction of f at x
space A TangentSpace representing the tangent to fM at f(x)

Raises
NotImplementedError if the TangentSpace subclass does not implement transform_general.