Skip to content

ActivationFunction Class

This class is responsible for housing the basic activation functions used in the library. As it didn't really need any extra work, this is directly ported from the first library.
When choosing a function, you can only choose 1 of the supported functions below:

• Identity  • Binary       • Sigmoid    • Tanh
• ArcTan • Sin • Sinc • ArSinh
• SoftPlus • BentIdentity • ReLU • SoftReLU
• LeakyReLU • Swish • ElliotSign • Gaussian
• SQ-RBF

ActivationFunction .new(string activName) Creates and returns the ActivationFunction with the !activName! indicating which activation function to use.
number :Calculate(number x,bool deriv) Calculates the Y of the activation function given the !x!, or, if !deriv! is true, instead returns the derivative tangent of the function at !x!.
number :GetValue(number x) Calculates the Y of the activation function given the !x!.
number :GetDeriv(number x) Calculates the derivative tangent of the activation function at !x!.
void :SetActivator(string activName) Sets the activation function. Be sure to review the possible options at the top of the page.
string :GetActivator() Returns the currently set activation function name.