act_method {LearnSL} | R Documentation |
Activation Function
Description
Upon a received input, calculates the output based on the
selected activation function
Usage
act_method(method, x)
Arguments
method |
Activation function to be used. It must be one of
"step" , "sine" , "tangent" , "linear" , "relu" ,
"gelu" or "swish" .
|
x |
Input value to be used in the activation function.
|
Details
Formulae used:
- step
-
f(x)={01if x<thresholdif x≥threshold
- sine
f(x)=sinh(x)
- tangent
f(x)=tanh(x)
- linear
x
- relu
-
f(x)={x0if x>0if x≤0
- gelu
f(x)=21⋅x⋅(1+tanh(π2⋅(x+0.044715⋅x3)))
- swish
f(x)=1+e−xx
Value
List with the weights of the inputs.
Author(s)
Víctor Amador Padilla, victor.amador@edu.uah.es
Examples
# example code
act_method("step", 0.3)
act_method("gelu", 0.7)
[Package
LearnSL version 1.0.0
Index]