crossEntropy chart for now

This commit is contained in:
Mahdi Dibaiee 2016-09-16 14:36:42 +04:30
parent 6def5f6197
commit 313e120f25
2 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,8 @@ A simple Machine Learning library.
, epochs = 1000
, training = zip inputs labels
, test = zip inputs labels
, drawChart = True
, chartName = "nn.png" -- draws chart of loss over time
} :: Session
initialCost = crossEntropy session

View File

@ -256,6 +256,7 @@ module Sibe
shuffled <- shuffleM pairs
let newnet = foldl' (\n (input, label) -> train input n label alpha) net pairs
cost = crossEntropy (session { network = newnet })
let el = map (\(e, l, _) -> (e, l)) (chart session)
ea = map (\(e, _, a) -> (e, a)) (chart session)
@ -268,6 +269,7 @@ module Sibe
return session { network = newnet
, epoch = epoch session + 1
, chart = (epoch session, cost, learningRate session):chart session
}
sgd :: Session -> IO Session