@@ -249,14 +249,14 @@ def _betainc_der_continued_fraction(a, b, x, dtype, where):
249
249
cf , cf_grad_a , cf_grad_b = _betainc_modified_lentz_method (
250
250
a , b , x , dtype , where )
251
251
252
- more_terms = tf .math .exp (
252
+ normalization = tf .math .exp (
253
253
tf .math .xlogy (a , x ) + tf .math .xlog1py (b , - x ) -
254
254
tf .math .log (a ) - lbeta (a , b ))
255
255
256
256
digamma_apb = tf .math .digamma (a + b )
257
- grad_a = more_terms * (cf_grad_a + cf * (tf .math .log (x ) -
257
+ grad_a = normalization * (cf_grad_a + cf * (tf .math .log (x ) -
258
258
tf .math .reciprocal (a ) + digamma_apb - tf .math .digamma (a )))
259
- grad_b = more_terms * (cf_grad_b + cf * (tf .math .log1p (- x ) +
259
+ grad_b = normalization * (cf_grad_b + cf * (tf .math .log1p (- x ) +
260
260
digamma_apb - tf .math .digamma (b )))
261
261
262
262
# If we are taking advantage of the symmetry relation, then we have to
@@ -344,13 +344,13 @@ def power_series_evaluation(should_stop, values, gradients):
344
344
_ , _ , series_sum = values
345
345
_ , series_grad_a , series_grad_b = gradients
346
346
347
- more_terms = tf .math .exp (
347
+ normalization = tf .math .exp (
348
348
tf .math .xlogy (safe_a , safe_x ) - lbeta (safe_a , safe_b ))
349
349
350
350
digamma_apb = tf .math .digamma (safe_a + safe_b )
351
- grad_a = more_terms * (series_grad_a + series_sum * (
351
+ grad_a = normalization * (series_grad_a + series_sum * (
352
352
digamma_apb - tf .math .digamma (safe_a ) + tf .math .log (safe_x )))
353
- grad_b = more_terms * (series_grad_b + series_sum * (
353
+ grad_b = normalization * (series_grad_b + series_sum * (
354
354
digamma_apb - tf .math .digamma (safe_b )))
355
355
356
356
# If we are taking advantage of the symmetry relation, then we have to
0 commit comments