Softmax

class dragon.vm.tensorflow.keras.layers.Softmax(
  axis=-1,
  **kwargs
)[source]

The layer to apply the softmax function.

The Softmax function is defined as:

\[\text{Softmax}(x) = \frac{e^{x_{i}}}{\sum e^{x_{j}}} \]

Examples:

x = tf.constant([-1, 0, 1], 'float32')
print(tf.keras.layers.Softmax(inplace=False)(x))

__init__

Softmax.__init__(
  axis=-1,
  **kwargs
)[source]

Create a Softmax layer.

Parameters:
  • axis (int, optional, default=-1) – The axis to reduce.