計算日誌 softmax 激活。 (不推薦使用的參數)
用法
tf.compat.v1.math.log_softmax(
logits, axis=None, name=None, dim=None
)
參數
-
logits
非空Tensor
。必須是以下類型之一:half
,float32
,float64
。 -
axis
將在維度上執行 softmax。默認值為 -1,表示最後一個維度。 -
name
操作的名稱(可選)。 -
dim
axis
的已棄用別名。
返回
-
一個
Tensor
。具有與logits
相同的類型。形狀與logits
相同。
拋出
-
InvalidArgumentError
如果logits
為空或axis
超出logits
的最後一個維度。
警告:不推薦使用某些參數:(dim)
。它們將在未來的版本中被刪除。更新說明: dim 已棄用,請改用axis
對於每個批次 i
和類 j
我們有
logsoftmax = logits - log(reduce_sum(exp(logits), axis))
相關用法
- Python tf.compat.v1.math.softmax用法及代碼示例
- Python tf.compat.v1.map_fn用法及代碼示例
- Python tf.compat.v1.make_template用法及代碼示例
- Python tf.compat.v1.mixed_precision.enable_mixed_precision_graph_rewrite用法及代碼示例
- Python tf.compat.v1.metrics.mean用法及代碼示例
- Python tf.compat.v1.multinomial用法及代碼示例
- Python tf.compat.v1.mixed_precision.MixedPrecisionLossScaleOptimizer用法及代碼示例
- Python tf.compat.v1.metrics.accuracy用法及代碼示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代碼示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_distribute_dataset用法及代碼示例
- Python tf.compat.v1.data.TFRecordDataset.interleave用法及代碼示例
- Python tf.compat.v1.distributions.Bernoulli.cross_entropy用法及代碼示例
- Python tf.compat.v1.Variable.eval用法及代碼示例
- Python tf.compat.v1.train.FtrlOptimizer.compute_gradients用法及代碼示例
- Python tf.compat.v1.layers.conv3d用法及代碼示例
- Python tf.compat.v1.strings.length用法及代碼示例
- Python tf.compat.v1.data.Dataset.snapshot用法及代碼示例
- Python tf.compat.v1.data.experimental.SqlDataset.reduce用法及代碼示例
- Python tf.compat.v1.feature_column.categorical_column_with_vocabulary_file用法及代碼示例
- Python tf.compat.v1.data.TextLineDataset.from_tensors用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.compat.v1.math.log_softmax。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。