import Network
import Numeric.LinearAlgebra

trainData :: Samples Double
trainData = [(vector [0, 0], vector [0]),
             (vector [0, 1], vector [1]),
             (vector [1, 0], vector [1]),
             (vector [0, 0], vector [0])]

l1 = Layer { weights = (3><2) [1..], biases = vector [1..3] }
l2 = Layer { weights = (1><3) [1..], biases = vector [1] }
fixedNet = Network [l1, l2]

debug _ _ = "Bla!"

main :: IO ()
main = do
    net <- newNetwork [2, 3, 1]
    {-let smartNet = update 0.06 net trainData-}
    {-[>let smartNet = trainSGD net trainData 4 0.06<]-}
    let debug _ _ = ""
        smartNet = trainNTimes 100000 debug net trainData 4 100
    putStrLn "Output after learning: "
    mapM_ (print . Network.output smartNet sigmoid . fst) trainData
