Nonlinear Activation Functions
This library provides several nonlinear functions commonly used as activation functions in neural networks.
Interface
To use this library, prefix the types and functions below with Nonlinear.
.
Methods
val sigmoid : real -> real
val dsigmoid : real -> real
val tanh : real -> real
val dtanh : real -> real
val sigmoidf : real -> real
val sigmoidh : real -> real
val sigmoidg : real -> real
val softmax : real array * int -> real
val exp : real -> real
val log : real -> real
Method Overview
sigmoid x
- Sigmoid function. Returns
1.0 / (1.0 + (e^(-x)))
.
- Sigmoid function. Returns
dsigmoid x
- Derivative of sigmoid.
tanh (x)
- The hyperbolic tangent.
dtanh x
.- Derivative of tanh.
sigmoidf x
- Alias for the sigmoid function.
sigmoidh x
- Returns
2.0 / (1.0 + (e^(-x))) - 1.0
.
- Returns
sigmoidg x
- Returns
4.0 / (1.0 + (e^(-x))) - 2.0
.
- Returns
softmax (arr, n)
- The softmax function.
exp x
- Returns the base of the natural logarithm raised to the
x
th power.
- Returns the base of the natural logarithm raised to the
log x
- The natural logarithm.