on master help sign in
Update types in README
commit8cd875a62d3d07a9962cd57d6bee6732cb75d171 authorHuw Campbell <huw.campbell@ambiata.com> dateTue 6 Dec 2016, 21:07 (10 years ago) parenta87fde1
1 file changed+5−10
README.md+5−10
README.md+5−10
@@ -14,17 +14,12 @@ Grenade is a dependently typed, practical, and pretty quick neural network libra
1414specifications of complex networks in Haskell.
1515
1616As an example, a network which can achieve less than 1.5% error on MNIST can be specified and
17−initialised with random weights in under 10 lines of code with
17+initialised with random weights in a few lines of code with
1818```haskell
19−randomMnistNet :: MonadRandom m => m (Network '[ 'D2 28 28, 'D3 24 24 10, 'D3 12 12 10, 'D3 12 12 10, 'D3 8 8 16, 'D3 4 4 16, 'D1 256, 'D1 256, 'D1 80, 'D1 80, 'D1 10, 'D1 10])
20−randomMnistNet = do
21− a :: Convolution 1 10 5 5 1 1 <- randomConvolution
22− let b :: Pooling 2 2 2 2 = Pooling
23− c :: Convolution 10 16 5 5 1 1 <- randomConvolution
24− let d :: Pooling 2 2 2 2 = Pooling
25− e :: FullyConnected 256 80 <- randomFullyConnected
26− f :: FullyConnected 80 10 <- randomFullyConnected
27− return $ a :~> b :~> Relu :~> c :~> d :~> FlattenLayer :~> Relu :~> e :~> Logit :~> f :~> O Logit
19+randomMnist :: MonadRandom m
20+ => m (Network '[ Convolution 1 10 5 5 1 1, Pooling 2 2 2 2, Relu, Convolution 10 16 5 5 1 1, Pooling 2 2 2 2, FlattenLayer, Relu, FullyConnected 256 80, Logit, FullyConnected 80 10, Logit]
21+ '[ 'D2 28 28, 'D3 24 24 10, 'D3 12 12 10, 'D3 12 12 10, 'D3 8 8 16, 'D3 4 4 16, 'D1 256, 'D1 256, 'D1 80, 'D1 80, 'D1 10, 'D1 10])
22+randomMnist = randomNetwork
2823```
2924
3025The network can be thought of as a heterogeneous list of layers, and its type signature includes a type