elisa.util.bslogu#
Bi-Symmetric log transformation for uniform distribution.
See https://iopscience.iop.org/article/10.1088/0957-0233/24/2/027001.
Contributed by @xiesl97 (xiesl97).
- class BiSymTransform(domain=Real(), c=0.43429448190325176)[source]#
Bases:
TransformAttributes
signSign of the derivative of the transform if it is bijective.
codomain
inv
Methods
__call__(x)Call self as a function.
forward_shape(shape)Infers the shape of the forward computation, given the input shape.
inverse_shape(shape)Infers the shapes of the inverse computation, given the output shape.
call_with_intermediates
domain
log_abs_det_jacobian
tree_flatten
tree_unflatten
- property codomain#
- class BiSymLogUniform(low, high, *, c=0.43429448190325176, validate_args=None)[source]#
Bases:
TransformedDistributionthe input should be transfor before input
for example: import numpy as np import bslogu as bs from numpyro.distributions import LogUniform, Uniform
Uniform( low , high ) LogUniform( np.log(low) , np.log(high) ) BiSymLogUniform( bs.log(low) , bs.log(high) )
Attributes
batch_shapeReturns the shape over which the distribution parameters are batched.
event_dimevent_shapeReturns the shape of a single sample from the distribution without batching.
Mean of the distribution.
Variance of the distribution.
has_rsample
is_discrete
support
Methods
__call__(*args, **kwargs)Call self as a function.
cdf(x)The cumulative distribution function of this distribution.
entropy()Returns the entropy of the distribution.
enumerate_support([expand])Returns an array with shape len(support) x batch_shape containing all values in the support.
expand(batch_shape)Returns a new
ExpandedDistributioninstance with batch dimensions expanded to batch_shape.expand_by(sample_shape)Expands a distribution by adding
sample_shapeto the left side of itsbatch_shape.get_args()Get arguments of the distribution.
icdf(q)The inverse cumulative distribution function of this distribution.
infer_shapes(*args, **kwargs)Infers
batch_shapeandevent_shapegiven shapes of args to__init__().mask(mask)Masks a distribution by a boolean or boolean-valued array that is broadcastable to the distributions
Distribution.batch_shape.sample(key[, sample_shape])Returns a sample from the distribution having shape given by sample_shape + batch_shape + event_shape.
sample_with_intermediates(key[, sample_shape])Same as
sampleexcept that any intermediate computations are returned (useful for TransformedDistribution).shape([sample_shape])The tensor shape of samples from this distribution.
to_event([reinterpreted_batch_ndims])Interpret the rightmost reinterpreted_batch_ndims batch dimensions as dependent event dimensions.
validate_args([strict])Validate the arguments of the distribution.
gather_pytree_aux_fields
gather_pytree_data_fields
log_prob
rsample
set_default_validate_args
support
tree_flatten
tree_unflatten
- arg_constraints: dict[str, Any] = {'high': Dependent(), 'low': Dependent()}#
- reparametrized_params: list[str] = ['low', 'high']#
- pytree_data_fields: tuple = ('low', 'high', '_support')#
- property support#
- property mean#
Mean of the distribution.
- property variance#
Variance of the distribution.