Package smile.deep.activation
Class Softmax
java.lang.Object
smile.deep.activation.Softmax
- All Implemented Interfaces:
Serializable
,ActivationFunction
Softmax for multi-class cross entropy objection function.
The values of units in output layer can be regarded as
posteriori probabilities of each class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Softmax
public Softmax()Constructor.
-
-
Method Details
-
name
Description copied from interface:ActivationFunction
Returns the name of activation function.- Specified by:
name
in interfaceActivationFunction
- Returns:
- the name of activation function.
-
f
public void f(double[] x) Description copied from interface:ActivationFunction
The output function.- Specified by:
f
in interfaceActivationFunction
- Parameters:
x
- the input vector.
-
g
public void g(double[] g, double[] y) Description copied from interface:ActivationFunction
The gradient function.- Specified by:
g
in interfaceActivationFunction
- Parameters:
g
- the gradient vector. On input, it holds W'*g, where W and g are the weight matrix and gradient of upper layer, respectively. On output, it is the gradient of this layer.y
- the output vector.
-