Class GELU
java.lang.Object
io.github.kirstenali.deepj.activations.GELU
- All Implemented Interfaces:
ActivationFunction
Gaussian Error Linear Unit (GELU), using the tanh approximation popularized by GPT-2.
Forward: x * 0.5 * (1 + tanh(sqrt(2/pi)*(x + 0.044715*x^3))).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GELU
public GELU()
-
-
Method Details
-
forward
- Specified by:
forwardin interfaceActivationFunction
-
backward
- Specified by:
backwardin interfaceActivationFunction
-