diff options
author | 2018-10-01 16:16:43 -0700 | |
---|---|---|
committer | 2018-10-01 16:20:57 -0700 | |
commit | 49bbfec04b729960999ef054e3acab719631b101 (patch) | |
tree | 38d7b43176036eb466a52196ef9c1fc5108d5e5e /tensorflow/python/ops | |
parent | 24333d8e55bdd995089e93122750340bf8d1ddba (diff) |
Override implementation of log survival for Exponential distribution to better handle small values.
PiperOrigin-RevId: 215299532
Diffstat (limited to 'tensorflow/python/ops')
-rw-r--r-- | tensorflow/python/ops/distributions/exponential.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/python/ops/distributions/exponential.py b/tensorflow/python/ops/distributions/exponential.py index 4325a14449..02129b5e2a 100644 --- a/tensorflow/python/ops/distributions/exponential.py +++ b/tensorflow/python/ops/distributions/exponential.py @@ -114,6 +114,9 @@ class Exponential(gamma.Gamma): def rate(self): return self._rate + def _log_survival_function(self, value): + return self._log_prob(value) - math_ops.log(self._rate) + def _sample_n(self, n, seed=None): shape = array_ops.concat([[n], array_ops.shape(self._rate)], 0) # Uniform variates must be sampled from the open-interval `(0, 1)` rather |