Warning: This project is deprecated. TensorFlow Addons has stopped development,
The project will only be providing minimal maintenance releases until May 2024. See the full
announcement here or on
github.
tfa.seq2seq.safe_cumprod
Computes cumprod of x in logspace using cumsum to avoid underflow.
tfa.seq2seq.safe_cumprod(
x: tfa.types.TensorLike
,
*args,
**kwargs
) -> tf.Tensor
The cumprod function and its gradient can result in numerical instabilities
when its argument has very small and/or zero values. As long as the
argument is all positive, we can instead compute the cumulative product as
exp(cumsum(log(x))). This function can be called identically to
tf.cumprod.
Args |
x
|
Tensor to take the cumulative product of.
|
*args
|
Passed on to cumsum; these are identical to those in cumprod.
|
**kwargs
|
Passed on to cumsum; these are identical to those in cumprod.
|
Returns |
Cumulative product of x.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-05-25 UTC.
[null,null,["Last updated 2023-05-25 UTC."],[],[]]