forked from tensorflow/probability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Hypothesis test that log_prob(sample) does not violate sample v…
…alidation and is never nan. There are several legitimate exceptions to this invariant: - Bijectors introduced by TransformedDistribution can introduce nans; in at least one case (SoftmaxCentered) this cannot be avoided by changing the bijector. TransformedDistribution is therefore excluded. Testing that Bijectors do not introduce unnecessary nans is deferred to a later change. - The meta-distributions Sample and Independent can combine +-inf log densities from the base distribution into nan. - Mixtures (whether same family or not) can violate sample validation by showing a sample from mixture component A to mixture component B, which may have a different support. - QuantizedDistribution's log_prob depends on the cdf of the underlying distribution. Testing that cdfs do not introduce unnecessary nans is deferred to a later change, whereupon QuantizedDistribution can be re-enabled. Besides that, found 19 other violations, of which 8 are small fixes in this CL, 4 look like small-ish fixes TBD soon, and 7 filed as bugs in their own right (two of which have been fixed while this CL was in flight). The fixes: - Use multiply_no_nan in ProbitBernoulli, same as in Bernoulli - Mask out edge-case inputs to GammaGamma, GeneralizedExtremeValue, LogLogistic, and LogNormal. Masks register as ok because `log` is effectively discontinuous at 0 and +inf. - Cause VonMisesFisher to emit samples on its support manifold, by brute-force normalizing them. - Cause Pareto to emit samples on its support manifold, with slightly more careful numerics in the sampler. - Adjust the computation of GeneralizedExtremeValue's support to numerically agree with the sampler. - Fix typos in documentation of BetaQuotient. PiperOrigin-RevId: 355074224
- Loading branch information
1 parent
b331bee
commit cbbbad0
Showing
15 changed files
with
192 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.