Jupyter notebook is available on gist:
https://gist.github.com/marypwchin/f7fa3e570b62ed863d0c76f443ad45d4
In this notebook we look at 3 ways of finding the output shape and number of parameters layer by layer:
- Keras’ built-in method: model.summary();
- our home-made method: mysummary(model);
- manual back-of-the-envelope calculation.
We beginning by defining our home-made method, mysummary(model). Worked examples of different network architectures, of fully connected and 2D convolution layers, will follow later.
This notebook is the function API version, which matches cell-by-cell with the companion sequential class version. Sequential class and functional API are two different ways of defining a neural network architecture in Keras.