Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`Adam.step` bias‑correction may underflow for large step counts

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

还没有人认领这个 Issue。

评估

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

调研方向

从 leanpass/optim.py 开始,检查 Adam.step 如何计算偏差校正后的矩。检查现有的优化器测试(如果有),并验证大步数下的行为。完成意味着在大的 self.t 下偏差校正仍然准确,且不改变预期的 Adam 更新。

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

描述

help wanted

File: leanpass/optim.py

The bias‑corrected moments are computed as self.m[i] / (1 - self.b1 ** self.t) and similarly for v. For large self.t (e.g., >1e5) self.b1 ** self.t underflows to 0, making the denominator exactly 1 and losing the bias correction. While not a crash, it deviates from the algorithm and can affect convergence.

Fix: Compute the denominator using np.power(self.b1, self.t, dtype=np.float64) or keep a running bias_correction1 *= self.b1 and use 1 - bias_correction1. This preserves precision for many steps.

File: leanpass/optim.py

Filed automatically by ai-issue-scan.

主要语言
Python
星标
16
派生
1
平均合并
2 天 8 小时
30 天内合并 PR
5

环境准备

从这里开始

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

Terminay/leanpass 的其他 Issue

查看 Terminay/leanpass 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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