Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- data Neuron a = Neuron {}
- type ActivationFunction a = a -> a
- type ActivationFunction' a = a -> a
- sigmoidNeuron :: Floating a => Neuron a
- tanhNeuron :: Floating a => Neuron a
- recluNeuron :: Floating a => Neuron a
- sigmoid :: Floating a => a -> a
- sigmoid' :: Floating a => a -> a
- tanh :: Floating a => a -> a
- tanh' :: Floating a => a -> a
- reclu :: Floating a => a -> a
- reclu' :: Floating a => a -> a
Documentation
Using this structure allows users of the library to create their own neurons by creating two functions - an activation function and its derivative - and packaging them up into a neuron type.
type ActivationFunction a = a -> a Source
type ActivationFunction' a = a -> a Source
sigmoidNeuron :: Floating a => Neuron a Source
Our provided neuron types: sigmoid, tanh, reclu
tanhNeuron :: Floating a => Neuron a Source
recluNeuron :: Floating a => Neuron a Source
sigmoid :: Floating a => a -> a Source
The sigmoid activation function, a standard activation function defined on the range (0, 1).
sigmoid' :: Floating a => a -> a Source
The derivative of the sigmoid function conveniently can be computed in terms of the sigmoid function.
tanh' :: Floating a => a -> a Source
The hyperbolic tangent activation function is provided in Prelude. Here we provide the derivative. As with the sigmoid function, the derivative of tanh can be computed in terms of tanh.