on master help sign in
Nicer types, and better regulariser so mnist actually works
commit109d5be3cae1dd79ede2bb87ee309931749ecb8d authorHuw Campbell <huw.campbell@ambiata.com> dateSun 4 Dec 2016, 11:20 (10 years ago) parent70fbac3
3 files changed+5−5
main/feedforward.hs+2−2 main/mnist.hs+2−2 src/Grenade/Core/Network.hs+1−1
main/feedforward.hs+2−2
@@ -26,7 +26,7 @@ import Grenade
2626-- between the shapes, so inference can't do it all for us.
2727
2828-- With around 100000 examples, this should show two clear circles which have been learned by the network.
29−randomNet :: (MonadRandom m) => m (Network '[ 'D1 2, 'D1 40, 'D1 40, 'D1 10, 'D1 10, 'D1 1, 'D1 1])
29+randomNet :: MonadRandom m => m (Network '[ 'D1 2, 'D1 40, 'D1 40, 'D1 10, 'D1 10, 'D1 1, 'D1 1])
3030randomNet = do
3131 a :: FullyConnected 2 40 <- randomFullyConnected
3232 b :: FullyConnected 40 10 <- randomFullyConnected
@@ -74,7 +74,7 @@ feedForward' =
7474 <*> (LearningParameters
7575 <$> option auto (long "train_rate" <> short 'r' <> value 0.01)
7676 <*> option auto (long "momentum" <> value 0.9)
77− <*> option auto (long "l2" <> value 0.0001)
77+ <*> option auto (long "l2" <> value 0.0005)
7878 )
7979
8080main :: IO ()
main/mnist.hs+2−2
@@ -74,11 +74,11 @@ data MnistOpts = MnistOpts FilePath FilePath Int LearningParameters
7474mnist' :: Parser MnistOpts
7575mnist' = MnistOpts <$> argument str (metavar "TRAIN")
7676 <*> argument str (metavar "VALIDATE")
77− <*> option auto (long "iterations" <> short 'i' <> value 15)
77+ <*> option auto (long "iterations" <> short 'i' <> value 10)
7878 <*> (LearningParameters
7979 <$> option auto (long "train_rate" <> short 'r' <> value 0.01)
8080 <*> option auto (long "momentum" <> value 0.9)
81− <*> option auto (long "l2" <> value 0.0001)
81+ <*> option auto (long "l2" <> value 0.0005)
8282 )
8383
8484main :: IO ()
src/Grenade/Core/Network.hs+1−1
@@ -31,7 +31,7 @@ class UpdateLayer x where
3131 -- Unit if there isn't a gradient to pass back.
3232 type Gradient x :: *
3333 -- | Update a layer with its gradient and learning parameters
34− runUpdate :: LearningParameters -> x -> Gradient x -> x
34+ runUpdate :: LearningParameters -> x -> Gradient x -> x
3535
3636-- | Class for a layer. All layers implement this, however, they don't
3737-- need to implement it for all shapes, only ones which are appropriate.