Package smile.base.mlp
Enum Class OutputFunction
- All Implemented Interfaces:
Serializable
,Comparable<OutputFunction>
,Constable
The output function of neural networks.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
f
(double[] x) The output function.abstract void
The gradient function.static OutputFunction
Returns the enum constant of this class with the specified name.static OutputFunction[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LINEAR
Linear/Identity function. -
SIGMOID
Logistic sigmoid function: sigmoid(v)=1/(1+exp(-v)). For multi-class classification, each unit in output layer corresponds to a class. For binary classification and cross entropy error function, there is only one output unit whose value can be regarded as posteriori probability. -
SOFTMAX
Softmax for multi-class cross entropy objection function. The values of units in output layer can be regarded as posteriori probabilities of each class.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
f
public abstract void f(double[] x) The output function.- Parameters:
x
- the input vector.
-
g
The gradient function.- Parameters:
cost
- the cost function of neural network.g
- the gradient vector. On input, it holds target - output. On output, it is the gradient.y
- the output vector.
-