Skip to content

Commit 4b8182b

Browse files
brianwa84tensorflower-gardener
authored andcommitted
Bound concentration away from zero for hp testing.
PiperOrigin-RevId: 681544617
1 parent ebc43b5 commit 4b8182b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorflow_probability/python/distributions/generalized_pareto_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def generalized_paretos(draw, batch_shape=None):
4040
constraints = dict(
4141
loc=tfp_hps.identity_fn,
4242
scale=tfp_hps.softplus_plus_eps(),
43-
concentration=lambda x: tf.math.tanh(x) * 0.24) # <.25==safe for variance
43+
# concentration < .25 ==> safe for variance
44+
concentration=lambda x: tf.math.tanh(x) * 0.24 + 1e-6)
4445

4546
params = draw(
4647
tfp_hps.broadcasting_params(

0 commit comments

Comments
 (0)