hgalib-0.1: Haskell Genetic Algorithm LibrarySource codeContentsIndex
Chromosome.ANN
Description
Artificial Neural Networks
Synopsis
type ANN = [Layer]
type Layer = [Node]
type Node = [Double]
eval :: [Double] -> ANN -> [Double]
config
uniformCross :: ANN -> ANN -> GAState c p (ANN, ANN)
averageCross :: ANN -> ANN -> GAState c p (ANN, ANN)
mutateRandomize :: Double -> Double -> ANN -> GAState ANN p ANN
mutateShift :: Double -> Double -> ANN -> GAState ANN p ANN
fitnessMSE :: [([Double], [Double])] -> ANN -> Double
averageMSE :: ANN -> [([Double], [Double])] -> Double
correctExamples :: [([Double], [Double])] -> Double -> ANN -> Double
randomANN :: Int -> [Int] -> Double -> GAState c p ANN
Documentation
type ANN = [Layer]Source
An Artificial Neural Network
type Layer = [Node]Source
A layer of nodes in an ANN
type Node = [Double]Source
A node in an ANN. The head of the list is the bias weight. The tail is the weights for the previous layer
eval :: [Double] -> ANN -> [Double]Source
Evaluates an ANN with a given input
config
uniformCross :: ANN -> ANN -> GAState c p (ANN, ANN)Source
Crossover between two ANN's by exchanging weights
averageCross :: ANN -> ANN -> GAState c p (ANN, ANN)Source
Crossover between two ANN's by averaging weights
mutateRandomize :: Double -> Double -> ANN -> GAState ANN p ANNSource
Mutates an ANN by randomly settings weights to +/- range
mutateShift :: Double -> Double -> ANN -> GAState ANN p ANNSource
Mutates an ANN by randomly shifting weights by +/- range
fitnessMSE :: [([Double], [Double])] -> ANN -> DoubleSource
Computes the fitness based on the mean square error for a list of examples The examples are a list of tuples of (input, output)
averageMSE :: ANN -> [([Double], [Double])] -> DoubleSource
Computes the mean square error for a list of examples The examples are a list of tuples of (input, output)
correctExamples :: [([Double], [Double])] -> Double -> ANN -> DoubleSource
Returns the number of examples correct within the tolerance. The examples are a list of tuples of (input, output)
randomANN :: Int -> [Int] -> Double -> GAState c p ANNSource
Generates a random ANN with a given number of input nodes, a list of number of hidden nodes per layer, and the weight range
Produced by Haddock version 2.4.2