min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse it

未关闭 适合新手
#1,072 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
testing

调研方向

首先追踪所列 sampler 类型对 min_objective 的解析和验证方式,然后检查该键的文档和现有配置测试。添加测试,确保每个 sampler 在启动时都拒绝此设置,并说明该设置仅适用于优化器;拒绝测试通过且文档说明 min_objective 适用于优化器,即表示完成。

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

描述

bug

min_objective is an optimizer's stop: "Stop fitting if an objective function lower than this value is reached." Samplers honour it too. A sampler run stops at the first proposal that scores below it, prints "Minimum objective value achieved" and "Fitting complete", and exits 0. It has run a small fraction of the requested iterations, and has a correspondingly small samples.txt.

A low objective on a sampler is just a draw near the mode, not a goal reached. And because when the run stops depends on the chain's own path, the draws it kept are not a fixed-length sample of the posterior. The run also writes no final credible intervals or histograms, the same end state as a wall_time_fit stop (#1068).

Found while reviewing #1066. Reproduced on main at cbb8159c. Since #921, a min_objective stop before the first draw is an error, whose hint says this key stops a sampler. A stop after the first draw is still reported as success.

Reproduction
edition = 2
objective = gaussian, mean = 0 0, variance = 1 1
uniform_var = g1 -10 10
uniform_var = g2 -10 10
random_seed = 1
output_dir = out
job_type = dream
population_size = 4
max_iterations = 20000
burn_in = 10
min_objective = 0.002

pybnf -c x.conf -o:

  • It prints "Completed iteration 610 of 20000", "Minimum objective value achieved" and "Fitting complete", and exits 0.
  • samples.txt has 24 draws, against about 800 for the full run at the default sample_every = 100.
  • Results/ has no credible* files.
What should happen

Refuse min_objective for every sampler (am, dream, p_dream, mh, pt, hmc) at start, naming the key and saying it applies to optimizers. Add a test for the refusal. Update the key's documentation to say so.

主要语言
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 摘要。