Repository navigation
Preserve Quantized epsilon in sampling and batch slicing - #365
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_probcalls.Samples, default
eps=Nonebehavior, 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.py618 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 --checkpass. No dependency or workflow changes.