Diffused uniform prior has zero score far outside the box
Maintainers usually reply within 6 days
Nobody has claimed this yet.
- #2295 by @JayBhadoria11 — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- backend, machine-learning
Research direction
Find the UniformNormalConvolution implementation returned by BoxUniform.marginalize and read how log_prob computes tail mass. Check the score behavior at 10, 13, and 500 noise standard deviations against the Gaussian-tail expectation, then add a regression test comparing the far-outside score with that tail. An open linked pull request (#2295) indicates work is already underway.
Written by the indexing model from the issue text.
Description
The diffused uniform prior loses its score far outside the box.
Affine classifier-free guidance and the iid methods gauss, auto_gauss and jac_gauss need the score of the prior at each diffusion time. For a BoxUniform prior, marginalize returns a UniformNormalConvolution: the box convolved with Gaussian noise. Outside the box, its score should point back to the box and grow with the distance, as in a Gaussian tail.
From about 13 noise standard deviations outside the box, the probability mass underflows in float32. log_prob clamps it to the smallest float, so the score becomes exactly zero:
| Distance outside the box | Score | Expected |
|---|---|---|
| 10 noise sd | -1010 | about -1000 |
| 13 noise sd | 0 | about -1300 |
| 500 noise sd | 0 | about -50000 |
Near the end of sampling the noise is small, so 13 noise standard deviations are close to the box. Samples beyond that get no pull back towards the box.
The fix: compute the log of the mass in log space, for example with torch.special.log_ndtr, so that the tail keeps its slope. A test can compare the score far outside the box with the Gaussian tail.
- 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
-
TARP reference sampling fails when a parameter coordinate is fixedPossibly taken @Jayant-kernel claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
sbi-dev/sbi#2264 · 2 comments ·
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
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day