aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/ops
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-10-01 16:16:43 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-01 16:20:57 -0700
commit49bbfec04b729960999ef054e3acab719631b101 (patch)
tree38d7b43176036eb466a52196ef9c1fc5108d5e5e /tensorflow/python/ops
parent24333d8e55bdd995089e93122750340bf8d1ddba (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.py3
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