BUG: Bernoulli(logit_p=...) 当 logit_p 较大时,其梯度会为 nan,尽管 logp 是有限的
作者: habakan创建于 2026年9月27日更新于 2026年9月27日
Describe the issue:
With logit_p, Bernoulli.dist builds p = sigmoid(logit_p), and logp uses log1p(-p) for an observed 0. The value is fine, but the gradient is nan once 1 - p rounds to 0, from about logit_p = 37. An observed 1 with a very negative logit is fine, since it goes through log(p).
内容来源: pymc-devs/pymc