@@ -35,24 +35,30 @@ type Shakespeare = RecurrentNetwork '[ R (LSTM 40 80), R (LSTM 80 40), F (FullyC
3535 '[ 'D1 40, 'D1 80, 'D1 40, 'D1 40, 'D1 40 ]
3636```
3737
38+Design
39+------
3840
39−The network can be thought of as a heterogeneous list of layers, where its type
40−includes not only the layers of the network, but also the shapes of data that
41−are passed between the layers.
41+Networks in Grenade can be thought of as a heterogeneous lists of layers, where
42+their type includes not only the layers of the network, but also the shapes of
43+data that are passed between the layers.
4244
45+The definition of a network is surprisingly simple:
4346```haskell
4447data Network :: [*] -> [Shape] -> * where
45− O :: Layer x i o => !x -> Network '[x] '[i, o]
46− (:~>) :: Layer x i h => !x -> !(Network xs (h ': hs)) -> Network (x ': xs) (i ': h ': hs)
48+ O :: (SingI i, SingI o, Layer x i o) => !x -> Network '[x] '[i, o]
49+ (:~>) :: (SingI i, SingI h, Layer x i h) => !x -> !(Network xs (h ': hs)) -> Network (x ': xs) (i ': h ': hs)
4750```
4851
4952The `Layer x i o` constraint ensures that the layer `x` can sensibly perform a
5053transformation between the input and output shapes `i` and `o`.
5154
52−In the above example, the input layer can be seen to be a two dimensional (`D2`),
53−image with 28 by 28 pixels. When the first *Convolution* layer runs, it outputs
54−a three dimensional (`D3`) 24x24x10 image. The last item in the list is one
55−dimensional (`D1`) with 10 values, representing the categories of the MNIST
55+The lifted data kind `Shape` defines our 1, 2, and 3 dimension types, used to
56+declare what shape of data is passed between the layers.
57+
58+In the MNIST example above, the input layer can be seen to be a two dimensional
59+(`D2`), image with 28 by 28 pixels. When the first *Convolution* layer runs, it
60+outputs a three dimensional (`D3`) 24x24x10 image. The last item in the list is
61+one dimensional (`D1`) with 10 values, representing the categories of the MNIST
5662data.
5763
5864Usage