DeterministicParameter#

class dynode.config.deterministic_parameter.DeterministicParameter(depends_on: str, index: int | tuple | slice | None = None, transform: ~typing.Callable[[~typing.Any], ~typing.Any] = <function DeterministicParameter.<lambda>>)#

Bases: object

A parameter whose value depends on a different parameter’s value.

__init__(depends_on: str, index: int | tuple | slice | None = None, transform: ~typing.Callable[[~typing.Any], ~typing.Any] = <function DeterministicParameter.<lambda>>)#

Specify a linkage between this DeterministicParameter and another value.

Parameters#

depends_onstr

str identifier of the parameter to which this instance is linked.

indexOptional[int | tuple | slice], optional

optional index in case depends_on is a list you wish to index, by default None, grabs entire list if isinstance(parameter_state[depends_on], list)).

Methods

__init__(depends_on[, index, transform])

Specify a linkage between this DeterministicParameter and another value.

resolve(parameter_state)

Retrieve value from self.depends_on from parameter_state.

resolve(parameter_state: dict[str, Any]) Any#

Retrieve value from self.depends_on from parameter_state.

Marking it as deterministic within numpyro.

Parameters#

parameter_statedict[str, Any]

current parameters, must include self.depends_on in keys.

Returns#

Any

value at parameter_state[self.depends_on][self.index]

Raises#

IndexError

if parameter_state[self.depends_on][self.index] does not exist or attempt to index with tuple on type list.

TypeError

if parameter_state[self.depends_on] is of type list, but self.index is a tuple, you cant index a list with a tuple, only a slice.