Env#

class hybrid_aif.envs.Env[source]#

Bases: Module

Abstract functional environment (pymdp’s Env, with value semantics).

An Env is an equinox.Module carrying only static structure; every array-valued parameter travels in a separate params pytree passed to each call, so one instance vmaps across a batch of parameter sets. reset() and step() are pure and unjitted (callers jit, vmap or scan them). In the positional convention an observation is a tuple of scalar int32 indices, one per modality; a state a tuple of scalar int32 indices, one per state factor; and an action an int32 (num_states,) array, one level per state factor (an uncontrolled state factor exposes a single no-op action). A GenerativeEnv speaks name-keyed mappings instead.

abstract property num_states: int#

Number of state factors.

null_action()[source]#

The no-op action, with the structure and shape every action this env takes.

Default: the level-index action, (num_states,) int32 zeros.

abstractmethod reset(key, params)[source]#

Sample an initial state and an observation of it.

abstractmethod step(key, state, action, params)[source]#

Sample the next state given action, and an observation of it.

__init__()#