on master help sign in
Fix input backprop
commitbad6d0effc450c2951a66e57a4f1f916300ac4c3 authorHuw Campbell <huw.campbell@ambiata.com> dateTue 7 Feb 2017, 13:24 (10 years ago) parenta153aff
2 files changed+7−1
src/Grenade/Recurrent/Core/Runner.hs+1−1 test/Test/Grenade/Layers/PadCrop.hs+6
src/Grenade/Recurrent/Core/Runner.hs+1−1
@@ -74,7 +74,7 @@ updateRecInputs l@LearningParameters {..} (() :~~+> xs) (() :~~+> ys)
7474 = () :~~+> updateRecInputs l xs ys
7575
7676updateRecInputs l@LearningParameters {..} (x :~@+> xs) (y :~@+> ys)
77− = (realToFrac (learningRate * learningRegulariser) * x - realToFrac learningRate * y) :~@+> updateRecInputs l xs ys
77+ = (realToFrac (1 - learningRate * learningRegulariser) * x - realToFrac learningRate * y) :~@+> updateRecInputs l xs ys
7878
7979updateRecInputs _ RINil RINil
8080 = RINil
test/Test/Grenade/Layers/PadCrop.hs+6
@@ -1,10 +1,16 @@
11{-# LANGUAGE BangPatterns #-}
2+{-# LANGUAGE CPP #-}
23{-# LANGUAGE TemplateHaskell #-}
34{-# LANGUAGE DataKinds #-}
45{-# LANGUAGE KindSignatures #-}
56{-# LANGUAGE GADTs #-}
67{-# LANGUAGE ScopedTypeVariables #-}
78{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
9+
10+#if __GLASGOW_HASKELL__ < 800
11+{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
12+#endif
13+
814module Test.Grenade.Layers.PadCrop where
915
1016import Grenade