Class Sigmoid
java.lang.Object
com.jml.neural_network.activations.Sigmoid
- All Implemented Interfaces:
ActivationFunction
The sigmoid activation function. f(x) = 1/(1+exp(-x))
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlinalg.Matrixback(linalg.Matrix data)Applies the derivative of the sigmoid activation function element-wise to a matrix.linalg.Matrixforward(linalg.Matrix data)Applies the sigmoid activation element-wise to a matrix.getName()Gets the name of the activation function.
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Sigmoid
public Sigmoid()
-
-
Method Details
-
forward
public linalg.Matrix forward(linalg.Matrix data)Applies the sigmoid activation element-wise to a matrix.- Specified by:
forwardin interfaceActivationFunction- Parameters:
data- Matrix to apply sigmoid activation to.- Returns:
- The result of the sigmoid activation applied element-wise to the data matrix.
-
back
public linalg.Matrix back(linalg.Matrix data)Applies the derivative of the sigmoid activation function element-wise to a matrix.- Specified by:
backin interfaceActivationFunction- Parameters:
data- Matrix to apply the derivative of the sigmoid activation function to.- Returns:
- The result of the derivative of the sigmoid activation applied element-wise to the data.
-
getName
Gets the name of the activation function.- Specified by:
getNamein interfaceActivationFunction- Returns:
- The name of the activation function as a String.
-