Commit 4e662f3a authored by Marco Herzog's avatar Marco Herzog

Update NeuralNetwork.hs

parent 724920e0
......@@ -177,12 +177,11 @@ update [] _ _ = []
update _ [] _ = []
update (m:matrices) (u:updates) learningRate = m - fmap (*learningRate) u : update matrices updates learningRate
-- |
gradients :: [Matrix Float]
-> [Matrix Float]
-> [Matrix Float]
-> Matrix Float
-> [(Matrix Float, Matrix Float)]
-- | 'gradients' calculates the updates for the 'weights' and 'biases' of a 'NeuralNetwork'. This function is only to be called by 'apply'
gradients :: [Matrix Float] -- ^ The 'weight' matrix
-> [Matrix Float] -- ^ The 'bias' matrix
-> [Matrix Float] -- ^ The activations calculated by
gradients [] _ _ _ = []
gradients _ [] _ _ = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment