In this tutorial I demonstrate how Keras can be used to quickly implement deep learning architectures for rapid prototyping. Specifically, I build and train two networks on the CIFAR-10 dataset with image augmentation:
- A simplified VGG architecture using the Keras Sequential API.
- A Wide Residual Network (WRN) using the Keras Functional API.
Why Keras?
In my earlier tutorial I demonstrated how to use the low-level TensorFlow API to build and train a simple convolutional neural network (CNN). But such an approach is code-heavy and quickly becomes cumbersome when trying to rapidly prototype multiple ideas. Keras was designed to eliminate much of this overhead, making it faster to move from idea to experiment.
As well-articulated by Keras creator Francois Chollet in his post on the recent success of Keras in winning Kaggle competitions:
- “Your final models will typically share little in common with the solutions you envisioned when first approaching the problem, because …a-priori plans basically never survive confrontation with experimental reality. So winning is not so much about how good your theoretical vision is, it’s about how much contact with reality your vision has been through. …[Using] Keras allows you to iterate faster, to try more things. Ultimately, this enables you to win competitions (or publish papers). Being able to go from idea to result with the least possible delay is key to doing good research —that’s one of the core beliefs behind Keras.”
Notes:
- This IPython notebook is best viewed using Google Chrome; some images and hyperlinks may not work in Mozilla FireFox.
- To download the source code, which you can edit and execute yourself, save this link (.ipynb file extension).
Check out some of my past projects!
I’ve worked on technical projects in a variety of fields. Here are some highlights: