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