BatchedTrajectoryCallback

class jaxrens.cli.monitor.BatchedTrajectoryCallback(writers, energy_loggers=None, traj_interval=1, snapshot_interval=100)[source]

Bases: object

Trajectory + energy logging for multi-run NS.

Holds one writer and one (optional) energy logger per replica. On each iteration, iterates flat replica indices and writes the per-replica dead walker + energy entry. Snapshots follow the same pattern.

For PmapVmapRuns the state arrays have leading axes (G, P, ...); this callback flattens them to (G*P, ...) for per-replica slicing.

Parameters:
  • writers (list)

  • energy_loggers (list | None)

  • traj_interval (int)

  • snapshot_interval (int)