tf.compat.v2.math.log_softmax
Вычисляет активации log softmax.
tf.compat.v2.math.log_softmax(
logits, axis=None, name=None
)
Для каждого набора i и класса j у нас есть
logsoftmax = logits - log(reduce_sum(exp(logits), axis))
| Аргументы | |
|---|---|
logits | Непустой Tensor. Должен быть одного из следующих типов: half, float32, float64. |
axis | Размерность, по которой будет выполняться softmax. По умолчанию -1, что указывает на последнюю размерность. |
name | Имя операции (необязательно). |
| Возвращаемые значения | |
|---|---|
A Tensor. Имеет тот же тип, что и logits. Такая же форма, как у logits. |
| Исключения | |
|---|---|
InvalidArgumentError | если logits пусто или axis выходит за пределы последней размерности logits. |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/compat/v2/math/log_softmax