Rollout#

class hybrid_aif.train.Rollout[source]#

Bases: NamedTuple

One imagined trajectory’s per-step quantities. Leaves (H,) or (H+1,).

value: Array#

G as a value (the negated expected free energy), per step taken, (H,).

per_term: dict[str, Array]#

The value’s decomposition by term name, (H,) each.

critic: Array#

The critic at s_0 … s_H, (H+1,).

cont: Array#

The continuation head’s mode at s_1 … s_H, 0.0 or 1.0, (H,).

prior_entropy: Array#

H[p(stoch | deter)] at each step, (H,).

policy_entropy: Array#

H[pi(a | s)] at s_0 … s_{H-1}, (H,).

start_logprob: Array#

log pi(a_start | s_0), the content of the behaviour-cloning term.

start_features: Array#

The features at s_0 … s_{H-1}, for the critic loss, (H, feature).

static __new__(
_cls,
value,
per_term,
critic,
cont,
prior_entropy,
policy_entropy,
start_logprob,
start_features,
)#

Create new instance of Rollout(value, per_term, critic, cont, prior_entropy, policy_entropy, start_logprob, start_features)