Class Activations
java.lang.Object
com.jml.neural_network.activations.Activations
A class which contains methods for geting various pre-made
activation functions
for use in neural network
layers
.-
Field Summary
Modifier and TypeFieldDescriptionstatic ActivationFunction
A pre-defined instance of the linear activation function.static ActivationFunction
A pre-defined instance of the Relu (Rectified Linear Unit) activation function.static ActivationFunction
The sigmoid activation function.static ActivationFunction
A pre-defined instance of the hyperbolic tangent activation function. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ActivationFunction
linear()
Creates and returns a new instacne of the linear activation function.static ActivationFunction
relu()
Creates and returns a new relu activatoin function.static ActivationFunction
sigmoid()
Creates and returns a new instance of the sigmoid activation function.static ActivationFunction
softmax()
Creates and returns a new instance of the softmax activations function.static ActivationFunction
tanh()
Creates and returns a new instance of the hyperbolic tangent activation function.
-
Field Details
-
sigmoid
The sigmoid activation function. f(x)=1/(1+exp(-x)) -
relu
A pre-defined instance of the Relu (Rectified Linear Unit) activation function. f(x)=max(0, x) -
linear
A pre-defined instance of the linear activation function. f(x)=x. -
tanh
A pre-defined instance of the hyperbolic tangent activation function.f(x) = tanh(x) = (ex - e-x) / (ex + e-x)
-
-
Constructor Details
-
Activations
public Activations()
-
-
Method Details
-
sigmoid
Creates and returns a new instance of the sigmoid activation function.- Returns:
- The sigmoid activation function. f(x)=1/(1+exp(-x))
-
relu
Creates and returns a new relu activatoin function.- Returns:
- An instance of the Relu (Rectified Linear Unit) activation function. f(x)=max(0, x)
-
linear
Creates and returns a new instacne of the linear activation function.- Returns:
- An instance of the linear activation function. f(x)=x.
-
tanh
Creates and returns a new instance of the hyperbolic tangent activation function.- Returns:
- An instance of the he hyperbolic tangent activation function
f(x) = tanh(x) = (ex - e-x) / (ex + e-x)
-
softmax
Creates and returns a new instance of the softmax activations function.- Returns:
- The softmax activation function. f(x)i = exp(x_i) / sumj=1m( exp(xj) ) where x is a vector of length m and sumj=1m ( exp(xj) ) = exp(x1) + exp(x2) + ... + exp(xm)
-