计算日志 softmax 激活。 (不推荐使用的参数)
用法
tf.compat.v1.math.log_softmax(
logits, axis=None, name=None, dim=None
)参数
-
logits非空Tensor。必须是以下类型之一:half,float32,float64。 -
axis将在维度上执行 softmax。默认值为 -1,表示最后一个维度。 -
name操作的名称(可选)。 -
dimaxis的已弃用别名。
返回
-
一个
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
