Deep Ritz Training Recovery
When To Use
Use this skill after residual-network, stochastic-sampling, and variational-loss skills exist. It is for bounded recovery experiments that must prove the Deep Ritz mechanism executed without reading an original repository.
Inputs
- Attempt directory.
- Generated skills root.
- Runtime handoff JSON.
- Module plan target.
- Recovery settings: dimension, width, blocks, steps, batch sizes, beta, learning rate, seed.
Outputs
recovery/logs/training_trace.jsonwith loss, error, parameter snapshots, and optimizer evidence.recovery/recovery_result.jsonwith metric and mechanism checks.- Generated-skill invocation logs.
Workflow
- Import or call the generated network, sampler, and loss helpers.
- Prefer PyTorch autograd if available.
- Run fresh stochastic quadrature samples for each optimizer step.
- Record parameter changes with
params_beforeandparams_after. - Evaluate relative L2 error on a fixed validation batch.
- Mark reduced/proxy recovery honestly when the full paper budget is infeasible.
Validation
Run:
python tests/test_training_recovery.py
Limitations
The default harness is intentionally reduced and bounded. It validates mechanism fidelity, not the paper's full 50,000-step accuracy target.