BUG: ive is nan from |x| near 2e9 on, inherited from scipy.special.ive (scipy/scipy#18088)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 67/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
The issue identifies PyTensor’s scalar Ive implementation and the HSGPPeriodic spectral density as the affected paths, but names no source file or test. Start by locating Ive and its tests, then trace how it calls scipy.special.ive; reproduce the reported values near 2e9 and check the existing large-argument behavior. Done means large inputs return finite values consistent with the asymptotic behavior and the regression is covered by a test.
索引モデルが issue の本文から書いたものです。
説明
Describe the issue:
pt.ive(v, x) is nan from |x| of about 2e9 on, where the function is finite and smooth, close to 1 / sqrt(2 pi |x|). The nan comes from scipy.special.ive (AMOS reports a loss of significance, scipy/scipy#18088, open since 2023). Since PyTensor's Ive calls SciPy, it inherits it, and HSGPPeriodic's spectral density, ive(j, 1 / ls**2), is nan for a lengthscale below about 2.2e-5, which NUTS then rejects.
A fallback to the asymptotic expansion for large |x| in PyTensor's scalar Ive would avoid the NaN without waiting on SciPy.
Reproducible code example:
import numpy as np
import pytensor.tensor as pt
import scipy.special as sp
for x in [1e9, 2e9, 3e9]:
x = np.float64(x)
print(f"x={x:g}: pt.ive(0, x) = {float(pt.ive(0, x).eval())}, scipy = {sp.ive(0, x)}, 1/sqrt(2 pi x) = {1 / np.sqrt(2 * np.pi * x):.6e}")
x=1e+09: pt.ive(0, x) = 1.261566261167776e-05, scipy = 1.261566261167776e-05, 1/sqrt(2 pi x) = 1.261566e-05
x=2e+09: pt.ive(0, x) = nan, scipy = nan, 1/sqrt(2 pi x) = 8.920621e-06
x=3e+09: pt.ive(0, x) = nan, scipy = nan, 1/sqrt(2 pi x) = 7.283656e-06
mpmath at 50 digits: ive(0, 2e9) = 8.92062058132e-06 and ive(0, 3e9) = 7.28365620425e-06.
Error message:
None. The value is nan.
PyTensor version information:
pytensor 3.3.7, scipy 1.18.1, numpy 2.5.4, Python 3.12, macOS arm64.
Context for the issue:
Found while checking the spectral density of HSGPPeriodic at small lengthscales.
- 主要言語
- Python
- スター
- 654
- フォーク
- 258
- 平均マージ
- 3日 41分
- マージ済み PR(30日)
- 42
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pymc-devs/pytensor のほかの issue
-
Docs of mode still mentions C/CVM as the default with FAST_RUN対応中かも @ADITYASINGH1206 が 8 日前に担当しました。 オープンdocs
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
pymc-devs/pytensor#2641 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
docs
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
BUG: geomspace returns wrong sign for the endpoints when start and stop are negative対応中かも @mayuriphad が 27 日前に担当しました。 オープン
難易度 2/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Reciprocal.impl computes np.float32(1.0) / x: float32 precision for float64 scalars under NEP 50 (Python linker)再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pymc-devs/pytensor#2430 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pymc-devs/pytensor#2428 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
pymc-devs/pytensor の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
dgunning/edgartools#2019 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
topoteretes/cognee#6818 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
source_verification_agent: no outcome when the publisher confirms a work but its DOI resolves to a different record対応中かも @pinjun99 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Imbad0202/academic-research-skills#1159 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: DoubleMLData.from_arrays checks the treatment d with force_all_x_finite instead of force_all_d_finite対応中かも @leninworld が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
DoubleML/doubleml-for-py#471 ·
メンテナーはふだん 1 日以内に返信