计算日志 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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
