Gradient fits on small-magnitude data return their start point as converged: the first-order stopping test is absolute, so it passes where the objective itself is tiny

未关闭
#1,058 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Start with the implementations of the gntr, trf, and lbfgs stopping criteria and the multiple-shooting tolerances ms_final_grad_tol and ms_optimality_tol. Reproduce the small-magnitude example, including A0 = 3e-5, and inspect the reported objective, gradient tolerance, and start-point parameters. Done means the affected fits no longer report convergence merely because an absolute gradient test passes, with regression coverage for small data and the existing larger-data behavior preserved.

由索引模型根据 Issue 内容生成。

描述

What you see. A gradient fit (job_type = gntr, trf or lbfgs) on data whose values are small, such as molar concentrations, can return its start point unchanged and report "Stop criterion satisfied" and "Fitting complete". The data say otherwise, and nothing in the output says the fit never moved.

Example. The model is A() -> B() at k1 and B() -> 0 at k2, with A0 = 3e-5. It is fitted to exact Btot data at t = 1..10, generated at k1 = 0.5 and k2 = 0.2, so the optimum is objective 0 there. The config uses objective = sos, loguniform_var k1 and k2 in [0.01, 10], and population_size = 1, so the fit starts at the box centre, k1 = k2 = 0.316.

job_type reported best k1 k2
gntr 8.217e-11 0.316228 (start) 0.316228 (start)
trf 8.217e-11 0.316228 (start) 0.316228 (start)
lbfgs 8.217e-11 0.316228 (start) 0.316228 (start)

Each run prints Stop criterion satisfied with objective function value of 8.217227743771922e-11.

Why. The first-order stopping tests (gntr_grad_tol, trf_grad_tol and their peers, default 1e-8) are absolute. With data of order 1e-5 the objective is of order 1e-10, and so is its gradient at a point far from the optimum. The test passes at the start, and the runner returns it as "gradient already flat at the start point". The same gntr job with A0 = 0.003 (data 100 times larger) moves from the same start to k1 = 0.49976, k2 = 0.20005 (objective 4.7e-13). The same holds for multiple shooting (ms_final_grad_tol, and ms_optimality_tol on its segmented rungs; see #914).

Possible fixes. Make the gradient test relative to the objective's own scale, or to its value at the start. Or refuse to call an unmoved start converged when the objective there is far from what the data allow. At the least, say in the result that the fit stopped at its start point.

Found during independent review of the multiple-shooting batch (#911–#915, #959, #1038, #1049).

主要语言
Python
星标
26
派生
25
平均合并
4 小时 25 分钟
30 天内合并 PR
9

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

lanl/PyBNF 的其他 Issue

查看 lanl/PyBNF 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。