BUG: ive is nan from |x| near 2e9 on, inherited from scipy.special.ive (scipy/scipy#18088)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 67/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend, machine-learning
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 654
- Fork
- 258
- Merge medio
- 2g 7h
- PR unite (30g)
- 39
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pymc-devs/pytensor
-
Docs of mode still mentions C/CVM as the default with FAST_RUNForse già presa @ADITYASINGH1206 l’ha presa 8 giorni fa. Apertadocs
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
pymc-devs/pytensor#2641 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
BUG: geomspace returns wrong sign for the endpoints when start and stop are negativeForse già presa @mayuriphad l’ha presa 27 giorni fa. Aperta
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Reciprocal.impl computes np.float32(1.0) / x: float32 precision for float64 scalars under NEP 50 (Python linker)Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pymc-devs/pytensor#2430 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pymc-devs/pytensor#2428 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pymc-devs/pytensor
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
dgunning/edgartools#2019 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
topoteretes/cognee#6818 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
source_verification_agent: no outcome when the publisher confirms a work but its DOI resolves to a different recordForse già presa @pinjun99 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Imbad0202/academic-research-skills#1159 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: DoubleMLData.from_arrays checks the treatment d with force_all_x_finite instead of force_all_d_finiteForse già presa @leninworld l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
DoubleML/doubleml-for-py#471 ·
I maintainer di solito rispondono entro 1 giorno