tf.compat.v2.math.softmax
Вычисляет активации softmax.
tf.compat.v2.math.softmax(
logits, axis=None, name=None
)
Эта функция выполняет эквивалент
softmax = tf.exp(logits) / tf.reduce_sum(tf.exp(logits), axis)
| Аргументы | |
|---|---|
logits | Непустой Tensor. Должен быть одного из следующих типов: half, float32, float64. |
axis | Размерность, на которой будет выполняться softmax. По умолчанию -1, что указывает на последнюю размерность. |
name | Имя операции (необязательно). |
| Возвращаемое значение | |
|---|---|
A Tensor. Имеет тот же тип и форму, что и 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/softmax