waxmorph.jax.train.TrainConfig#
- class waxmorph.jax.train.TrainConfig(n_epochs=2000, t_rollout=100, mech_steps=5, diff_steps=5, dt_mech=0.01, dt_diff=0.01, dt_gns=0.01, D_emu=0.1, lambda_reg=0.001, grad_clip_norm=1.0, log_every=10, max_edges_factor=10)[source]#
Bases:
objectJAX rollout and optimizer settings for a fixed agent count.
n_epochscounts optimizer updates. Histories evaluate every post-update model, so training performs one additional rollout. Zeromech_stepsordiff_stepsselects the identity path for that prescribed update.dt_mechanddt_diffare explicit-Euler steps; diffusion stability depends onD_emu * dt_diffand graph degree.dt_gnsscales the rawdX,dP, anddcheads before state updates.The total loss is
\[L=L_{shape}+\lambda_{reg}\sum_t \lVert \Delta t_{GNS}\,GNS_{X,t}\rVert_F^2,\]where the displacement term is measured before mechanics.
grad_clip_norm=Nonekeeps the computed gradients. JAX addsmax_edges_factor: both directed-edge and neighbor-pair buffers are bounded byN * max_edges_factor; overflow raises while preserving the configured static shape.Examples
>>> cfg = TrainConfig(n_epochs=3, t_rollout=2) >>> print(cfg.n_epochs, cfg.t_rollout, cfg.grad_clip_norm) 3 2 1.0