stack_traces

Contents

stack_traces#

hybrid_aif.stack_traces(traces)[source]#

Pad variable-length traces to one T and stack them: the batch convention (R7).

Each trace is (observations, actions, present_or_None), keyed as replay() takes them, with leading axes of one length. Returns (observations, actions, present, valid) with a leading batch axis: padding rows are zeros, absent (present False) and invalid (valid False). Replay a batch with jax.vmap(lambda o, a, m, v: replay(system, params, o, a, present=m, valid=v)).