roll_batch

Contents

roll_batch#

hybrid_aif.train.roll_batch(
system,
params,
actor_m,
critic_m,
start_beliefs,
keys,
*,
horizon,
bounds,
cont,
code_and_carry,
aux,
expert_actions,
sample_scoring=False,
)[source]#

A batch of sampled imagined trajectories: one Rollout with a leading axis.

Shared by imagine() and rollout_returns(). actor_m/critic_m are passed explicitly so the gradient can substitute traced copies; the critic is stop-gradiented here, and so is the actor’s conditioning state at every step (the actor’s gradient flows through its reparameterised draw and the dynamics).