neet-0.2.0.0: A NEAT library for Haskell

Copyright(c) Leon Medvinsky, 2015
LicenseGPL-3
Maintainerlmedvinsky@hotmail.com
Stabilityexperimental
Portabilityghc
Safe HaskellNone
LanguageHaskell2010

Neet.Network

Contents

Description

 

Synopsis

Sigmoid

modSig :: Double -> Double Source

Modified sigmoid function from the original NEAT paper

Network

data Network Source

Sparse recurrent network, like those made by NEAT

Constructors

Network 

Fields

netInputs :: [NodeId]

Which nodes are inputs

netOutputs :: [NodeId]

Which nodes are outputs

netState :: IntMap Neuron
 
netDepth :: Int

Upper bound on depth

Instances

Neuron

data Neuron Source

A single neuron

Constructors

Neuron 

Fields

activation :: Double

The current activation

connections :: IntMap Double

The inputs to this Neuron

yHeight :: Rational

Visualization height

neurType :: NodeType

Type, used in pushThrough

Instances

Construction

Updates

stepNeuron :: IntMap Double -> Neuron -> Neuron Source

Takes the previous step's activations and current inputs and gives a function to update a neuron.

stepNetwork :: Network -> [Double] -> Network Source

Steps a network one step. Takes the network and the current input, minus the bias.

snapshot :: Network -> [Double] -> Network Source

Steps a network for at least its depth

Output

pushThrough :: Network -> [Double] -> [Double] Source

Specialized snapshot for nonrecurrent nets. Will break on recurrent connections.

getOutput :: Network -> [Double] Source

Gets the output of the current state