waxmorph.torch.train.TrainConfig#
- class waxmorph.torch.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)[source]#
Bases:
objectRollout and optimizer settings for a fixed agent count.
n_epochscounts optimizer updates; histories evaluate each resulting model, requiring one extra rollout. Each rollout hast_rolloutlearned steps.mech_stepsanddiff_stepsare prescribed substep counts; zero selects the identity path for that correction.dt_gnsscales all learned deltas.dt_mechanddt_diffare explicit step sizes whose stable range depends on the active forces and graph; nonfinite states are rejected. Diffusion applies \(c\leftarrow\max(c-D_{emu}L_Gc\,\Delta t_{diff},0)\).The optimized loss is \(L=L_{shape}+\lambda_{reg}L_{reg}\), where
\[L_{reg}=\sum_t\lVert\Delta t_{GNS}\,GNS_{X,t}\rVert_F^2.\]The regularizer measures learned displacement before the mechanics correction.
grad_clip_normcaps the global L2 gradient norm;Nonekeeps the computed gradients.log_everycontrols progress output. JAX addsmax_edges_factorfor its static edge capacity.Examples
>>> cfg = TrainConfig(n_epochs=3, t_rollout=2) >>> print(cfg.n_epochs, cfg.t_rollout, cfg.grad_clip_norm) 3 2 1.0