Skip to content

Preserve Quantized epsilon in sampling and batch slicing - #365

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/quantized-epsilon-scoring-parity-20261007
Open

sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/quantized-epsilon-scoring-parity-20261007

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Fixes #364.

Apply the existing epsilon gap rule in the optimized sample-and-score path, and preserve broadcast epsilon values when slicing batches. Both values and parameter gradients now agree with separate sampling and log_prob calls.

Samples, default eps=None behavior, clipping and the existing regularization definition are unchanged. PR #178's separate type-cast cleanup applies cleanly alongside this patch.

Validation

python -m pytest -q distrax/_src/distributions/quantized_test.py distrax/_src/distributions/quantized_eps_test.py

618 tests passed; 142 skipped. The 25 new tests cover Normal/Logistic bases, bounded and unbounded distributions, eager/JIT sampling parity, gradient parity, scalar/batch epsilon, multidimensional slicing and clipping endpoints. Eighteen new tests fail on unchanged source. The existing quantized-distribution suite also passed, including 912 subtests.

Tests used macOS CPU, JAX 0.11.2 and the existing TensorFlow Probability compatibility runtime. Its pre-existing deprecation warnings are still emitted. No accelerator or model-training run was performed.

New-test formatting, scoped syntax/lint checks and git diff --check pass. No dependency or workflow changes.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quantized sample scoring and slicing discard the configured epsilon gap

1 participant