Class Linear
java.lang.Object
deepnetts.net.layers.activation.Linear
- All Implemented Interfaces:
ActivationFunction, Serializable, Consumer<Tensor>
Linear activation function and its derivative.
Commonly used as an activation function in output layer for regression(numeric prediction) tasks.
By default it passes it's input to output y = k * x where k is given as slope parameter.
y = slope * x
y' = slope
slope parameter = 1 by default.
- See Also:
-
Constructor Details
-
Linear
public Linear() -
Linear
public Linear(int slope)
-
-
Method Details
-
getValue
public float getValue(float x) Description copied from interface:ActivationFunctionReturns the value of activation function for specified input x- Specified by:
getValuein interfaceActivationFunction- Parameters:
x- input for activation- Returns:
- value of activation function
-
getPrime
public float getPrime(float y) Description copied from interface:ActivationFunctionReturns the first derivative of activation function for specified output y- Specified by:
getPrimein interfaceActivationFunction- Parameters:
y- output of activation function- Returns:
- first derivative of activation function
-
apply
- Specified by:
applyin interfaceActivationFunction
-
apply
- Specified by:
applyin interfaceActivationFunction
-
apply
- Specified by:
applyin interfaceActivationFunction
-