計算張量 x
沿 axis
的累積乘積。
用法
tf.raw_ops.CumulativeLogsumexp(
x, axis, exclusive=False, reverse=False, name=None
)
參數
-
x
一個Tensor
。必須是以下類型之一:half
,float32
,float64
。一個Tensor
。必須是以下類型之一:float16
,float32
,float64
。 -
axis
一個Tensor
。必須是以下類型之一:int32
,int64
。Tensor
類型為int32
(默認值:0)。必須在[-rank(x), rank(x))
範圍內。 -
exclusive
可選的bool
。默認為False
。如果是True
,則執行排他累積log-sum-exp。 -
reverse
可選的bool
。默認為False
。bool
(默認值:False)。 -
name
操作的名稱(可選)。
返回
-
一個
Tensor
。具有與x
相同的類型。
默認情況下,此操作執行包含累積 log-sum-exp,這意味著輸入的第一個元素與輸出的第一個元素相同:
tf.math.cumulative_logsumexp([a, b, c]) # => [a, log(exp(a) + exp(b)), log(exp(a) + exp(b) + exp(c))]
通過將 exclusive
kwarg 設置為 True
,將執行獨占累積 log-sum-exp :
tf.cumulative_logsumexp([a, b, c], exclusive=True) # => [-inf, a, log(exp(a) * exp(b))]
請注意,log-sum-exp 操作的中性元素是 -inf
,但是,出於性能原因,使用浮點類型可表示的最小值代替。
通過將 reverse
kwarg 設置為 True
,累積 log-sum-exp 以相反的方向執行。
相關用法
- Python tf.raw_ops.Cumsum用法及代碼示例
- Python tf.raw_ops.Cumprod用法及代碼示例
- Python tf.raw_ops.ComplexAbs用法及代碼示例
- Python tf.raw_ops.Conv2D用法及代碼示例
- Python tf.raw_ops.Cos用法及代碼示例
- Python tf.raw_ops.Case用法及代碼示例
- Python tf.raw_ops.CheckNumerics用法及代碼示例
- Python tf.raw_ops.Conj用法及代碼示例
- Python tf.raw_ops.Cosh用法及代碼示例
- Python tf.raw_ops.Complex用法及代碼示例
- Python tf.raw_ops.ConcatOffset用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.Bitcast用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.BatchMatMul用法及代碼示例
- Python tf.raw_ops.OneHot用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代碼示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代碼示例
- Python tf.raw_ops.GatherV2用法及代碼示例
- Python tf.raw_ops.Expm1用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.CumulativeLogsumexp。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。