計算日誌 softmax 激活。
用法
tf.nn.log_softmax(
logits, axis=None, name=None
)參數
-
logits非空Tensor。必須是以下類型之一:half,float32,float64。 -
axis將在維度上執行 softmax。默認值為 -1,表示最後一個維度。 -
name操作的名稱(可選)。
返回
-
一個
Tensor。具有與logits相同的類型。形狀與logits相同。
拋出
-
InvalidArgumentError如果logits為空或axis超出logits的最後一個維度。
對於每個批次 i 和類 j 我們有
logsoftmax = logits - log(reduce_sum(exp(logits), axis))
相關用法
- Python tf.nn.log_poisson_loss用法及代碼示例
- Python tf.nn.local_response_normalization用法及代碼示例
- Python tf.nn.l2_loss用法及代碼示例
- Python tf.nn.embedding_lookup_sparse用法及代碼示例
- Python tf.nn.RNNCellResidualWrapper.set_weights用法及代碼示例
- Python tf.nn.dropout用法及代碼示例
- Python tf.nn.gelu用法及代碼示例
- Python tf.nn.RNNCellDeviceWrapper.set_weights用法及代碼示例
- Python tf.nn.embedding_lookup用法及代碼示例
- Python tf.nn.RNNCellDeviceWrapper.get_weights用法及代碼示例
- Python tf.nn.scale_regularization_loss用法及代碼示例
- Python tf.nn.RNNCellResidualWrapper.add_loss用法及代碼示例
- Python tf.nn.max_pool用法及代碼示例
- Python tf.nn.RNNCellDropoutWrapper.set_weights用法及代碼示例
- Python tf.nn.weighted_cross_entropy_with_logits用法及代碼示例
- Python tf.nn.ctc_greedy_decoder用法及代碼示例
- Python tf.nn.dilation2d用法及代碼示例
- Python tf.nn.RNNCellResidualWrapper.get_weights用法及代碼示例
- Python tf.nn.compute_average_loss用法及代碼示例
- Python tf.nn.RNNCellDeviceWrapper用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.nn.log_softmax。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
