Softmax

public class Softmax

Softmax converts a real vector to a vector of categorical probabilities.

The elements of the output vector are in range (0, 1) and sum to 1.

Each vector is handled independently. The axis argument sets which axis of the input the function is applied along.

Softmax is often used as the activation for the last layer of a classification network because the result could be interpreted as a probability distribution.

The softmax of each vector x is computed as: exp(x) / tf.sum(exp(x)).

The input values in are the log-odds of the resulting probability.

Public Constructors

Softmax(Ops tf)
Creates a softmax activation where the default axis is ERROR(/#AXIS_DEFAULT) which indicates the last dimension.
Softmax(Ops tf, int axis)
Creates a Softmax activation

Public Methods

Operand<T>
call(Operand<T> input)
Gets the calculation operation for the activation.

Inherited Methods

Public Constructors

public Softmax (Ops tf)

Creates a softmax activation where the default axis is ERROR(/#AXIS_DEFAULT) which indicates the last dimension.

Parameters
tf the TensorFlow Ops

public Softmax (Ops tf, int axis)

Creates a Softmax activation

Parameters
tf the TensorFlow Ops
axis The dimension softmax would be performed on.

Public Methods

public Operand<T> call (Operand<T> input)

Gets the calculation operation for the activation.

Parameters
input the input tensor
Returns
  • The operand for the activation