An Open source TensorFlow 2 Tutorial

TensorFlow 2 is a great Deep Learning framework. Let's see how we can use it.

Posted by January 16, 2020 · 5 mins read
Table of Content

At IUST, we have a bunch of courses around Deep Learning. Considering the goal for these courses, which is applied Deep Learning, the Keras framework was the primary choice to be taught in classes. In fact, Keras, due to its high-level and easy APIs, is an excellent fit for this use-case, which is verified by the feedback we had from students. However, as many students went further from the class’s scope and became interested in the research direction, they needed more flexibility. Please don’t get me wrong; Keras is a great framework, which can actually be useful in research but it may not be as productive as we want.

With the introduction of TensorFlow 2.0, we decided to replace Keras with TensorFlow. TensorFlow 2.0 brings the maturity of Keras modeling APIs accompanied by the flexibility and end-to-end ecosystem of tools that were created around TensorFlow 1. This combination of features makes the TensorFlow 2.0 a great choice for both production and research, especially as Eager Execution (Dynamic Graph) is enabled by default.

Therefore, we created a set tutorial for TensorFlow 2.0 to be taught in our classes, something similar to Stanford CS 20, but more compact and more up-to-date.

Header Photo from TF dev summit 19

How are these tutorials different from other materials on the Internet?

Let me answer this question using the contents from the official page:

First, we aim to approach TensorFlow 2.0 from a practical point of view so that you can start using the framework as soon as possible. Secondly, we try to include and use a wide range of information such as TF team talks, API references, and practical experiences in the making of these materials to make it as comprehensive as possible. Thus, the user can enjoy an all-in-one package. Finally, tutorials are organized in a simple-to-complex manner that can benefit many newcomers. Moreover, the assignments that come with these tutorials make them a ready-to-use option in use in special (short) courses.

What sections does it cover?

These tutorials are currently “under construction,” and we are completing them. Therefore, the list of sections can be changed in the course of development. However, here are the parts that currently, we plan to cover:

  1. TensorFlow Architecture: Computational Graph and the underlying components in TensorFlow are discussed.
  2. Tensors and Basic Operations: This part includes the explanations of Tensors, variable, and basic ops, which are commonly used in TensorFlow.
  3. Model Design APIs: We discuss the Keras APIs (sequential, functional, and model sub-classing) to create and design models. Sub-classing is of a particular focus in this section.
  4. Model Training APIs: Models are useless without training. Two different methods for learning, including custom training loops, are represented in this segment.
  5. TensorFlow Input Data Pipeline: One of the TensorFlow’s strengths is its flexible high-performance input pipeline. We go through the details and real-world use-cases in this part.
  6. Saving the Model: Saving and resuming the training is essential in Deep Learning, especially in the case of limited resources. We will describe the best solution for each application in this part.
  7. Transfer Learning & TensorHub: TensorHub is a fantastic repository of pre-trained models. In this section, you will learn their usage.
  8. TensorBoard: The model’s performance and its training should be monitored, which is discussed in this section.
  9. TF 2.0 for NLP: TensorFlow 2.0 has introduced several APIs for text such as Tokenizer and Ragged Tensors. We will learn how these APIs make our lives easier as an NLP researcher.
  10. TF 2.0 for Computer Vision: The same thing also holds for Computer Vision.

It is Open Source!

We believe that tutorials, similar to software projects, can also benefit from the open-source model. Therefore, we plan to manage this project using community opinions. If you think the tutorial can be made better by including particular content, you are more than welcome to share it with us and include it in GitHub. Additionally, we have prepared a bunch of templates to hasten the contribution and the creation of excellent materials.

The URL

You can access all materials here: https://github.com/iust-deep-learning/tensorflow-2-tutorial

Summary

I hope you find this set of tutorials useful. If you have any questions or feedback, the comment section is at your disposal.