@@ -16,7 +16,7 @@ import Data.Singletons.Prelude
16import Grenade.Core.Network
16import Grenade.Core.Network
17import Grenade.Core.Shape
17import Grenade.Core.Shape
19−-- | Drive and network and collect it's back propogated gradients.
19+-- | Drive and network and collect its back propogated gradients.
20backPropagate :: forall input output shapes layers. (Head shapes ~ input, Last shapes ~ output)
20backPropagate :: forall input output shapes layers. (Head shapes ~ input, Last shapes ~ output)
21 => Network layers shapes -> S' input -> S' output -> Gradients layers
21 => Network layers shapes -> S' input -> S' output -> Gradients layers
22backPropagate network input target =
22backPropagate network input target =
@@ -29,7 +29,7 @@ backPropagate network input target =
29 -- handle input from the beginning, feeding upwards.
29 -- handle input from the beginning, feeding upwards.
30 go !x (layer :~> n)
30 go !x (layer :~> n)
31 = let y = runForwards layer x
31 = let y = runForwards layer x
32− -- recursively run the rest of the network, and get the layer from above.
32+ -- recursively run the rest of the network, and get the gradients from above.
33 (n', dWs') = go y n
33 (n', dWs') = go y n
34 -- calculate the gradient for this layer to pass down,
34 -- calculate the gradient for this layer to pass down,
35 (layer', dWs) = runBackards layer x dWs'
35 (layer', dWs) = runBackards layer x dWs'