计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
deep_ritz_variational_energy_loss【效率与协作】Compute Deep Ritz variational energy losses with gradient energy and boundary penalties.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill to turn sampled PDE points and a differentiable trial function into a Ritz objective. It is appropriate for Poisson-type energy minimization and can be extended to Rayleigh quotient eigenvalue objectives.
u(x; theta).f(x).beta.mean(0.5 * |grad u|^2 - f * u).beta * mean((u_boundary - g_boundary)^2).Run:
python tests/test_energy_loss.py
Automatic differentiation requires PyTorch or another autograd runtime. Standard-library helpers provide exact-solution functions and numeric diagnostics but cannot replace full gradient-energy training.