crps_cnormal ignores the backend argument for the tail masses
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 20/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
調査の方向性
Read crps_cnormal and compare it with crps.gtcnormal, as the issue names both as relevant entry points. Check how the two _norm_cdf calls handle converted inputs and the requested backend. Done means the torch reproducer works with gradient-requiring tensors; pull request #142 is already open for this issue.
索引モデルが issue の本文から書いたものです。
説明
What happened?
crps_cnormal computes the censored masses with stats._norm_cdf(...) but doesn't pass backend on, so it uses the globally active backend (numpy by default) instead of the one requested. With torch tensors this goes through numpy, which fails for tensors that need gradients (and for GPU tensors). This is the same kind of bug as #98.
Suggested fix: pass backend=backend to both _norm_cdf calls, after converting the inputs with B.asarray, as crps.gtcnormal does.
Minimal reproducer
import torch
import scoringrules as sr
sr.register_backend("torch")
obs = torch.zeros(3)
mu = torch.zeros(3, requires_grad=True)
sigma = torch.ones(3)
# the active backend is still numpy
sr.crps_cnormal(obs, mu, sigma, -1.0, 1.0, backend="torch")
Backend
torch
Python version
3.12
scoringrules version
0.11.0
- 主要言語
- Python
- スター
- 108
- フォーク
- 15
- 平均マージ
- 1時間 42分
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
frazane/scoringrules のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
frazane/scoringrules#164 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
frazane/scoringrules#163 ·
メンテナーはふだん 1 日以内に返信
-
backend:torch bug documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
frazane/scoringrules#146 ·
メンテナーはふだん 1 日以内に返信
-
Bugs in the legacy TorchBackend対応中かも @frazane が今日担当しました。 オープンbackend:torch bug
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
frazane/scoringrules#147 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
frazane/scoringrules#145 ·
メンテナーはふだん 1 日以内に返信
frazane/scoringrules の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
adafruit/Fruit-Jam-OS#98 ·
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/semantic-kernel#14753 ·
メンテナーはふだん 5 日以内に返信
-
area:cli area:configuration documentation priority:low size:small
難易度 1/5 1〜3時間 初心者へのやさしさ 80/100
RonaldHensbergen/composable-data-stack#1222 ·
メンテナーはふだん 1 日以内に返信
-
bug python
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pvlib/pvlib-python#2939 ·
メンテナーはふだん 1 日以内に返信