hnn-0.1: A minimal Haskell Neural Network Library

AI.HNN.Layer

Contents

Description

Layer module, defining functions to work on a neural network layer, which is a list of neurons

Synopsis

Layer creation

createSigmoidLayerU :: Int -> Double -> UArr Double -> [Neuron]Source

Creates a layer compound of n neurons with the Sigmoid transfer function, all having the given threshold and weights.

createHeavysideLayerU :: Int -> Double -> UArr Double -> [Neuron]Source

Creates a layer compound of n neurons with the Heavyside transfer function, all having the given threshold and weights.

createSigmoidLayer :: Int -> Double -> [Double] -> [Neuron]Source

Creates a layer compound of n neurons with the sigmoid transfer function, all having the given threshold and weights.

createHeavysideLayer :: Int -> Double -> [Double] -> [Neuron]Source

Creates a layer compound of n neurons with the sigmoid transfer function, all having the given threshold and weights.

Computation

computeLayerU :: [Neuron] -> UArr Double -> UArr DoubleSource

Computes the outputs of each Neuron of the layer

computeLayer :: [Neuron] -> [Double] -> [Double]Source

Computes the outputs of each Neuron of the layer

Learning

learnSampleLayerU :: Double -> [Neuron] -> (UArr Double, UArr Double) -> [Neuron]Source

Trains each neuron with the given sample and the given learning ratio

learnSampleLayer :: Double -> [Neuron] -> ([Double], [Double]) -> [Neuron]Source

Trains each neuron with the given sample and the given learning ratio

learnSamplesLayerU :: Double -> [Neuron] -> [(UArr Double, UArr Double)] -> [Neuron]Source

Trains each neuron with the given samples and the given learning ratio

learnSamplesLayer :: Double -> [Neuron] -> [([Double], [Double])] -> [Neuron]Source

Trains each neuron with the given samples and the given learning ratio

Quadratic Error

quadErrorU :: [Neuron] -> (UArr Double, UArr Double) -> DoubleSource

Returns the quadratic error of a layer for a given sample

quadError :: [Neuron] -> ([Double], [Double]) -> DoubleSource

Returns the quadratic error of a layer for a given sample