constant#

Defines a Distribution which only has one value.

class Constant(value: T)#

Bases: object

An object which represents a constant value.

value#

The value.

Raises:

TypeError – If value is not a float or int.

Inits the Constant with the provided value.

Parameters:

value – The scalar used as constant value.

get_random_values(n: int) list[T]#

Returns an array of the constant value in the given shape.

Parameters:

n – The number of values.

Returns:

np.ndarray[float]

get_samples_from_hypercube(n: int) list[T]#

Samples n values from a hypercube.

Parameters:

n – the number of samples.

Returns:

Samples of the distributions, sampled from a hypercube.