WorldBatch#

class hybrid_aif.train.WorldBatch[source]#

Bases: NamedTuple

A batch of replay sequences, all shapes static.

obs: Array#

The observations, (B, T, obs_dim).

action: Array#

action[b, t] is a_{t-1}, the action that produced obs[b, t], (B, T, action_dim).

reward: Array#

The rewards, (B, T).

cont: Array#

1 - done, (B, T).

is_first: Array | None#

Where an episode begins inside a sequence, (B, T); the recurrent carry restarts there. Episode-aligned batches may leave it None.

check(core)[source]#

Validate against a core and return (B, T).

static __new__(_cls, obs, action, reward, cont, is_first=None)#

Create new instance of WorldBatch(obs, action, reward, cont, is_first)