From 4b8182b7d97f51cdf93475b6918d623a5a48e4f2 Mon Sep 17 00:00:00 2001 From: bjp Date: Wed, 2 Oct 2024 12:10:38 -0700 Subject: [PATCH] Bound concentration away from zero for hp testing. PiperOrigin-RevId: 681544617 --- .../python/distributions/generalized_pareto_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tensorflow_probability/python/distributions/generalized_pareto_test.py b/tensorflow_probability/python/distributions/generalized_pareto_test.py index 0c30b71124..92f274c43c 100644 --- a/tensorflow_probability/python/distributions/generalized_pareto_test.py +++ b/tensorflow_probability/python/distributions/generalized_pareto_test.py @@ -40,7 +40,8 @@ def generalized_paretos(draw, batch_shape=None): constraints = dict( loc=tfp_hps.identity_fn, scale=tfp_hps.softplus_plus_eps(), - concentration=lambda x: tf.math.tanh(x) * 0.24) # <.25==safe for variance + # concentration < .25 ==> safe for variance + concentration=lambda x: tf.math.tanh(x) * 0.24 + 1e-6) params = draw( tfp_hps.broadcasting_params(