TARP reference sampling fails when a parameter coordinate is fixed
Maintainers usually reply within 6 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 77/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- machine-learning
Research direction
Start with get_tarp_references in sbi/diagnostics/tarp.py and trace how it builds bounds and samples references. Reproduce the provided example, then check that zero-width coordinates use their observed value while varying coordinates are sampled as before. Done when the example runs and coverage matches the one-dimensional calculation, with and without normalization.
Written by the indexing model from the issue text.
Description
TARP's default reference sampler fails if one parameter stays fixed across the ground truths and posterior draws, even when other parameters vary. For example, augmenting a one-dimensional parameter with a known calibration constant should leave Euclidean distances unchanged.
import torch
from sbi.diagnostics.tarp import get_tarp_references
theta = torch.tensor([[0., 7.], [1., 7.], [2., 7.]])
samples = torch.stack([theta + torch.tensor([v, 0.]) for v in (-0.25, 0.25)])
get_tarp_references(theta, samples)
At 1c3d53d7 the bounds for the second coordinate are [7, 7]. PyTorch Uniform requires strictly ordered bounds and raises ValueError. I reproduced the exception on CPU with the checkout's reference sampling routines. As a control I sampled references in the varying coordinate and appended 7 manually. The original coverage calculation then agreed with the one-dimensional calculation using the same rank jitter, both with and without normalization. No posterior training was involved.
Sampling the varying coordinates uniformly and setting every zero-width coordinate to its observed value would keep the reference distribution on the observed box without introducing arbitrary noise into a fixed parameter.
- Dominant language
- Python
- Stars
- 894
- Forks
- 306
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 61
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sbi-dev/sbi
-
simulate_for_sbi(num_simulations=0) returns 1D empty theta/x tensors and breaks append_simulationsOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sbi-dev/sbi#2310 · 3 comments ·
Maintainers usually reply within 6 days
-
bug: RestrictionEstimator.train(subsample_invalid_sims="auto") raises TypeErrorPossibly taken @Nitesh780 claimed this 2 days ago. Openbug
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
sbi-dev/sbi#2309 · 1 comment ·
Maintainers usually reply within 6 days
-
fix: broadcast UniformNormalConvolution batch shapePossibly taken @studentarijitpaul claimed this 32 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
sbi-dev/sbi#2151 · 2 comments ·
Maintainers usually reply within 6 days
-
bug
sbi-dev/sbi#2321 · 1 comment ·
Maintainers usually reply within 6 days
-
SMCABC returns its final particles without their importance weights, so the samples are biasedPossibly taken @clarkf19 claimed this 1 day ago. Open
sbi-dev/sbi#2319 · 4 comments ·
Maintainers usually reply within 6 days
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day