Softmax

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

Layer to apply the softmax function.

The Softmax function is defined as:

\[\text{Softmax}(x_{i}) = \frac{\exp(x_{i})}{\sum_{j} \exp(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.