conv2d
Created by: benjaminkreis
library and example for 2D convolutional implemented in similar way as 1D
The example is trained on the famous MNIST handwritten digit dataset, but just using a subset of the image to keep the network small (see this repo). The architecture is 8x8 conv2d with 1 channel and 2 filters -> relu -> dense with 10 outputs -> softmax. With 32-bit fixed point numbers, the relative agreement with Keras is at the level of 10E-5 for the 10 outputs of the first sample before the softmax. After the softmax, it degrades quite a bit, but this is not specific to conv2d and can be followed up on separately.
With 18-bit fixed point numbers and reuse=1, it uses 1803 DSPs and 16 200 MHz clocks.
Next steps:
- the multiplier limit is ready for a compressed model, but this hasn't been tested
- the flatten function has been tested, but unflatten has not, which would be useful for architectures with multiple conv2d layers
- serial mode not implemented, similar to conv1d
- max pooling
- update hls-writer to do the translation