bases

jaxns.framework.bases

Module Contents

class BaseAbstractPrior(name=None)[source]

Bases: jaxns.framework.abc.AbstractPrior

The base prior class with public methods.

Parameters:

name (Optional[str]) –

property dtype[source]

The dtype of the prior random variable in X-space.

property base_shape: Tuple[int, Ellipsis][source]

The base shape of the prior random variable in U-space.

Return type:

Tuple[int, Ellipsis]

property base_ndims[source]

The number of dimensions of the prior random variable in U-space.

property shape: Tuple[int, Ellipsis][source]

The shape of the prior random variable in X-space.

Return type:

Tuple[int, Ellipsis]

__repr__()[source]

Return repr(self).

forward(U)[source]

The forward transformation from U-space to X-space.

Parameters:

U (jaxns.internals.types.UType) – U-space representation

Returns:

X-space representation

Return type:

jaxns.internals.types.RandomVariableType

inverse(X)[source]

The inverse transformation from X-space to U-space.

Parameters:

X (jaxns.internals.types.RandomVariableType) – X-space representation

Returns:

U-space representation

Return type:

jaxns.internals.types.UType

log_prob(X)[source]

The log probability of the prior.

Parameters:

X (jaxns.internals.types.RandomVariableType) – X-space representation

Returns:

log probability of the prior

Return type:

jaxns.internals.types.MeasureType

PriorModelGen[source]
PriorModelType[source]
class BaseAbstractModel(prior_model, log_likelihood)[source]

Bases: jaxns.framework.abc.AbstractModel

The base model class with public methods.

Parameters:
  • prior_model (PriorModelType) –

  • log_likelihood (jaxns.internals.types.LikelihoodType) –

property prior_model: PriorModelType[source]

The prior model.

Return type:

PriorModelType

property log_likelihood: jaxns.internals.types.LikelihoodType[source]

The log likelihood function.

Returns:

log likelihood function

Return type:

jaxns.internals.types.LikelihoodType

property U_placeholder: jaxns.internals.types.UType[source]

A placeholder for U-space sample.

Return type:

jaxns.internals.types.UType

property X_placeholder: jaxns.internals.types.XType[source]

A placeholder for X-space sample.

Return type:

jaxns.internals.types.XType

property U_ndims: int[source]

The prior dimensionality.

Return type:

int

class BaseAbstractDistribution[source]

Bases: jaxns.framework.abc.AbstractDistribution

The base distribution class with public methods.

property dtype[source]

The dtype of the distribution, in X-space.

property base_shape: Tuple[int, Ellipsis][source]

The base shape of the distribution, in U-space.

Return type:

Tuple[int, Ellipsis]

property shape: Tuple[int, Ellipsis][source]

The shape of the distribution, in X-space.

Return type:

Tuple[int, Ellipsis]

forward(U)[source]

The forward transformation from U-space to X-space.

Parameters:

U (jaxns.internals.types.UType) – U-space representation

Returns:

X-space representation

Return type:

jaxns.internals.types.RandomVariableType

inverse(X)[source]

The inverse transformation from X-space to U-space.

Parameters:

X (jaxns.internals.types.RandomVariableType) – X-space representation

Returns:

U-space representation

Return type:

jaxns.internals.types.UType

log_prob(X)[source]

The log probability of the distribution.

Parameters:

X (jaxns.internals.types.RandomVariableType) – X-space representation

Returns:

log probability of the distribution

Return type:

jaxns.internals.types.MeasureType