NeuralNetwork.hs
Here is the Haskell code that I wrote to make a neural network. Next I will train it to play Tic tac toe. Here starts Neuron.hs module NeuralNetwork.Neuron where import Data.Binary import qualified Data.Sequence as Seq data Node = Neuron { bias :: Double, priors :: [Int], weights :: [Double], hidden :: Bool } | Input { value :: Double } deriving (Show, Eq) instance Binary Node where put (Neuron{bias = bias, priors = priors, weights = weights, hidden = hidden}) = do put (0 :: Word8); put bias; put priors; put weights; put hidden put (Input{value = value}) = do put (1 :: Word8); put value get = do t <- get :: Get Word8 case t of 0 -> do b <- get; p <- get; w <- get; h <- get; ...