Tensorflow Eager Execution mode allows an imperative programming style, similar to Numpy in addition to nearly all of the Tensorflow graph APIs, higher level APIs to build models (Keras) as well as easy debugging with the Python debug bridge.
Since Eager Execution APIs are quite recent, some kinks still exist, but as of this moment, they are minor and can be sidesteped. These issues are highlighted in the notebooks and it is advised to browse through the comments, even if the topic is easy, so as to understand the limitations of Eager as TF 1.8.
The following set of examples show usage of higher level APIs of Keras, different ways of performing the same thing, some issues that can arise and how to sidestep them while we wait for updates in Tensorflow to fix them.
It is to be noted, that I try to replicate most parts of this excellent PyTorch Tutorial Set. A few topics are missing - such as GANs and Image Captioning since I do not have the computational resources to train such models. A notable exception is Style Transfer, for which I have another repository dedicated to it, so I won't be porting it to Eager.
A final note :
- Eager is evolving rapidly, and almost all of these issues that I stated here are edge cases that can/will be resolved in a later update. I still appreciate Eager, even with its limitations, as it offers a rich set of APIs from its Tensorflow heritage in an imperative execution environment like PyTorch.
- This means that once the Eager API has all of its kinks ironed out, it will result in cleaner, more concise code and hopefully at performance close to Tensorflow itself.
Provided are two links - The title link leads to the local Jupyter Notebook where as the Colab Link Leads to a Colaboratory notebook.
Please ensure to copy the contents of the notebook and run the command !pip install --upgrade tensorflow
at the top before any of the imports to ensure you are using the latest Tensorflow version, unless it is already done for you !
1. Basics
2. Intermediate
- CNN (Simple) - Colab
- CNN (Blocks) - Colab
- Mini Inception - Colab
- Mini ResNet - Colab
- RNN (Canonical) - Colab
- RNN (Custom) - Colab (CPU)
- RNN (Fast Hybrid) - Colab
- Bi-Directional RNN (Canonical) - Colab
- Bi-Directional RNN (Custom) - Colab
- RNN Language Model (Canonical) - Colab
- RNN Language Model (Custom) - Colab
3. Advanced
- Variational Autoencoders - Colab
- Models with Custom Variables + Saving / Restoring + Manual Gradient Updates + Datasets API - Colab
- Models with Custom Layers - Colab
- Tensorflow 1.9
- numpy
- PIL / Pillow to generate images for VAE
- matplotlib to display images for VAE