deep-learning-with-python-notebooks README

The project's README from github.com/fchollet/deep-learning-with-python-notebooks. As one markdown file: README.md.

Companion notebooks for Deep Learning with Python

This repository contains Jupyter notebooks implementing the code samples found in the book Deep Learning with Python, third edition (2025) by Francois Chollet and Matthew Watson. In addition, you will also find the legacy notebooks for the second edition (2021) and the first edition (2017).

For readability, these notebooks only contain runnable code blocks and section titles, and omit everything else in the book: text paragraphs, figures, and pseudocode. If you want to be able to follow what's going on, I recommend reading the notebooks side by side with your copy of the book.

Running the code

We recommend running these notebooks on Colab, which provides a hosted runtime with all the dependencies you will need. You can also, run these notebooks locally, either by setting up your own Jupyter environment, or using Colab's instructions for running locally.

By default, all notebooks will run on Colab's free tier GPU runtime, which is sufficient to run all code in this book. Chapter 8-18 chapters will benefit from a faster GPU if you have a Colab Pro subscription. You can change your runtime type using Runtime -> Change runtime type in Colab's dropdown menus.

Choosing a backend

The code for third edition is written using Keras 3. As such, it can be run with JAX, TensorFlow or PyTorch as a backend. To set the backend, update the backend in the cell at the top of the colab that looks like this:

import os
os.environ["KERAS_BACKEND"] = "jax"

This must be done only once per session before importing Keras. If you are in the middle running a notebook, you will need to restart the notebook session and rerun all relevant notebook cells. This can be done in using Runtime -> Restart Session in Colab's dropdown menus.

Using Kaggle data

This book uses datasets and model weights provided by Kaggle, an online Machine Learning community and platform. You will need to create a Kaggle login to run Kaggle code in this book; instructions are given in Chapter 8.

For chapters that need Kaggle data, you can login to Kaggle once per session when you hit the notebook cell with kagglehub.login(). Alternately, you can set up your Kaggle login information once as Colab secrets:

Following this approach you will only need to copy your Kaggle secret key once, though you will need to allow each notebook to access your secrets when running the relevant Kaggle code.

Table of contents

deep-learning-with-python-notebooks (fchollet/deep-learning-with-python-notebooks)

keras
Searching Database…

What is this?Companion Jupyter notebooks for the book 'Deep Learning with Python' by Francois Chollet (and Matthew Watson for the 3rd edition, 2025), implementing all its code samples, plus legacy notebooks for the 2nd edition (2021) and 1st edition (2017).
Are these notebooks meant to replace the book, or go along with it?They only contain runnable code blocks and section titles, with no explanatory text, figures, or pseudocode, so they're meant to be read side by side with your copy of the book.
How do I run the notebooks?The recommended way is Google Colab, which gives you a hosted runtime with all dependencies pre-installed; you can also run them locally with your own Jupyter setup.
Which deep learning framework do I need?Third-edition code is written in Keras 3, which can run on JAX, TensorFlow, or PyTorch as a backend; you pick one by setting a variable at the top of the notebook before importing Keras.
Do I need a Kaggle account for some chapters?Yes, chapters that use Kaggle-hosted datasets or model weights require a free Kaggle login, which you can provide each session via kagglehub.login() or store once as Colab secrets.
Can I switch backends mid-notebook?Not without restarting: the backend must be set once at the top of the session before importing Keras, and switching it requires a full session restart.
Do I need a powerful GPU to run the code?No, Colab's free-tier GPU runtime is enough to run all the code in the book; chapters 8-18 just run faster with a Colab Pro GPU.
What topics are covered across the chapters?They range from the math basics of neural networks through classification, CNN architectures, image segmentation and object detection, timeseries forecasting, text classification, transformers, and text/image generation.
Are older editions of the book still supported?Yes, legacy notebooks for the first edition (2017) and second edition (2021) are kept alongside the current third-edition notebooks.
Creator
fchollet
Size
7 MB
Stars
20.3K
Updated
CommitSep 18
Age
9y
Commits · 90 Days