• 8 hours
  • Hard

Free online content available in this course.

course.header.alt.is_certifying

Got it!

Last updated on 3/8/23

Set up Your Work Station

Differentiate Between Deep Learning Frameworks

Have you heard about TensorFlow, Keras, PyTorch? Have you ever wondered what they are and how they work?

All of these are frameworks. They are designed to help you build neural networks with existing components.

Google developed TensorFlow, Facebook created PyTorch, and Keras started as François Chollet’s project to make it faster and easier to build networks.

From a speed perspective, TensorFlow and PyTorch are more complex and require more code to work with. They were built to work fast with large datasets. In comparison, it is simpler to work with Keras, as it was built to allow for fast experimentation.

TensorFlow and PyTorch also require you to write code in a certain way with precise variable definitions or class definitions specific to them, whereas Keras simply uses Python.

Oh, and there is one more thing I haven’t told you yet - Keras is actually part of TensorFlow, which make Keras an accessible entry into TensorFlow. Since we are focused on rapid experimentation and learning about neural networks, let’s use Keras.

Install the Necessary Tools

Keras

To get Keras, you need to install Tensorflow. So go to your command line and run the following:

python3 -m pip install tensorflow==2.2.0

Want to try and see if it worked? Want to know if TensorFlow is using your machine’s graphical processing unit? Get a Python shell and type:

import tensorflow as tf
tf.config.list_physical_devices('GPU')

If it is, you’ll get an output similar to this:

A screenshot derived from Python.

Keras has three main modules that we will be using:

  • Models, which represent containers for the layers.

  • Layers, containing types of neurons as well as extra code for how those neurons should behave inside a layer.

  • Optimizers, which contain different algorithms used to teach the network.

Whenever we use Keras, we will use it straight from TensorFlow as follows:

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.optimizers import SGD

Pandas

The pandas data manipulation tool allows you to read data from multiple formats such as CSV and JSON and quickly inspect it. Moreover, it is extremely powerful for feature engineering allowing you to create new columns or features from existing ones easily. For this project, let’s use pandas version 25:

python3 -m pip install pandas==0.25.0

When looking at a dataset loaded with pandas, you’ll use methods such as:

  • head()or sample()to see parts of the data

  • describe()to understand the statistics of the data

  • apply()to modify the data or create new columns 

Matplotlib

You’ve probably used Matplotlib before. It allows you to plot charts and images and inspect data as well as training sessions. If you have it already installed, you don’t need to do anything about it, but if you don’t, please install it with the following command:

python3 -m pip install matplotlib==3.1.3

Jupyter Notebook

Finally, Jupyter Notebook is another well-known data science package that you’ve probably used before.  It allows you to write code and visualize the output in a web browser, making it easy to build notebooks and keep a log of your work. Again, you might have this one installed already, but just in case:

python3 -m pip install jupyter==1.0.0

We will be doing all the coding in Jupyter Notebooks in this course, and all the chapters have a notebook available for you to browse if you get stuck.

Let's Recap!

  • TensorFlow, Keras, and PyTorch are all frameworks. They are designed to help you build neural networks with existing components.

  • TensorFlowand PyTorch are more complex and require more code. Keras is easier to use and better adapted for learning and experimentation. 

You are now ready to go to the next part, where you will learn how neurons work and where you will train your first neural network!

Example of certificate of achievement
Example of certificate of achievement