|
|
|
|
|
| Description |
| Neuron module, defining an artificial neuron type and the basical operations we can do on it
|
|
| Synopsis |
|
|
|
|
| Type Definitions, type class instances
|
|
| data Neuron |
| Our Artificial Neuron type
| | Constructors | | Instances | |
|
|
| Neuron creation
|
|
| createNeuronU :: Double -> UArr Double -> (Double -> Double) -> Neuron |
| Creates a Neuron with the given threshold, weights and transfer function
|
|
| createNeuronHeavysideU :: Double -> UArr Double -> Neuron |
| Equivalent to `createNeuronU t ws heavyside'
|
|
| createNeuronSigmoidU :: Double -> UArr Double -> Neuron |
| Equivalent to `createNeuronU t ws sigmoid'
|
|
| createNeuron :: Double -> [Double] -> (Double -> Double) -> Neuron |
| Same as createNeuronU, with a list instead of an UArr for the weights (converted to UArr anyway)
|
|
| createNeuronHeavyside :: Double -> [Double] -> Neuron |
| Same as createNeuronHeavysideU, with a list instead of an UArr for the weights (converted to UArr anyway)
|
|
| createNeuronSigmoid :: Double -> [Double] -> Neuron |
| Same as createNeuronSigmoidU, with a list instead of an UArr for the weights (converted to UArr anyway)
|
|
| Transfer functions
|
|
| heavyside :: Double -> Double |
| The Heavyside function
|
|
| sigmoid :: Double -> Double |
| The Sigmoid function
|
|
| Neuron output computation
|
|
| computeU :: Neuron -> UArr Double -> Double |
| Computes the output of a given Neuron for given inputs
|
|
| compute :: Neuron -> [Double] -> Double |
| Computes the output of a given Neuron for given inputs
|
|
| Neuron learning with Widrow-Hoff (Delta rule)
|
|
| learnSampleU :: Double -> Neuron -> (UArr Double, Double) -> Neuron |
| Trains a neuron with the given sample, of the form (inputs, wanted_result) and the given learning ratio (alpha)
|
|
| learnSample :: Double -> Neuron -> ([Double], Double) -> Neuron |
|
| learnSamplesU :: Double -> Neuron -> [(UArr Double, Double)] -> Neuron |
| Trains a neuron with the given samples and the given learning ratio (alpha)
|
|
| learnSamples :: Double -> Neuron -> [([Double], Double)] -> Neuron |
| Trains a neuron with the given samples and the given learning ratio (alpha)
|
|
| Produced by Haddock version 2.4.2 |