stable_learning_control.algos.tf2.common.bijectors

Module that contains several TensorFlow bijectors. For more information on Bijectors see the TensorFlow documentation and this stackoverflow question.

Classes

SquashBijector

A squash bijector used to keeps track of the distribution properties when the

Module Contents

class stable_learning_control.algos.tf2.common.bijectors.SquashBijector(validate_args=False, name='tanh')[source]

Bases: tensorflow_probability.bijectors.Bijector

A squash bijector used to keeps track of the distribution properties when the distribution is transformed using the tanh squash function.

Initiate squashed bijector object.

Parameters:
  • validate_args (bool, optional) – Whether to validate input with asserts. If validate_args is False, and the inputs are invalid, correct behavior is not guaranteed. Defaults to False.

  • name (str, optional) – The name to give Ops created by the initialiser. Defaults to “tanh”.

_forward(x)[source]

Forward function. Useful for turning one random outcome into another random outcome from a different distribution.

Parameters:

x (structure) – The input to the ‘forward’ evaluation.

Returns:

Returns the forward Bijector evaluation, i.e., X = g(Y).

Return type:

structure

_inverse(y)[source]

Inverse bijection function. Useful for ‘reversing’ a transformation to compute one probability in terms of another.

Parameters:

y (structure) – The input to the ‘inverse’ evaluation.

Returns:

Return tensor if this bijector is injective. If not injective, returns the k-tuple containing the unique k points (x1, …, xk) such that g(xi) = y.

Return type:

structure

_forward_log_det_jacobian(x)[source]

The log of the absolute value of the determinant of the matrix of all first-order partial derivatives of the inverse function. Useful for inverting a transformation to compute one probability in terms of another. Geometrically, the Jacobian determinant is the volume of the transformation and is used to scale the probability.

Parameters:

x (structure) – The input to the ‘forward’ Jacobian determinant evaluation.

Returns:

Result tensor if this bijector is injective. If not

injective this is not implemented.

Return type:

structure