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)

Searching Database…

这是什么?这是《Deep Learning with Python》一书的配套 Jupyter 笔记本。该书作者为 Francois Chollet,第3版(2025年)由 Matthew Watson 参与编写。笔记本实现了书中的全部代码示例,并附有第2版(2021年)和第1版(2017年)的旧版笔记本。
这些笔记本是用来替代这本书,还是配合这本书使用?笔记本只包含可运行的代码块和章节标题,没有解释性文字、图表或伪代码,因此应当与你手里的书对照阅读。
我该怎么运行这些笔记本?推荐使用 Google Colab,它提供已预装所有依赖的托管运行环境。你也可以用自己的 Jupyter 环境在本地运行。
我需要哪个深度学习框架?第3版的代码基于 Keras 3 编写,它可以使用 JAX、TensorFlow 或 PyTorch 作为后端。在导入 Keras 之前,在笔记本顶部设置一个变量即可选择后端。
有些章节需要 Kaggle 账号吗?需要。使用 Kaggle 托管的数据集或模型权重的章节,需要登录一个免费的 Kaggle 账号。你可以每次会话通过 kagglehub.login() 登录,也可以将凭据一次性保存为 Colab secrets。
我能在笔记本运行中途切换后端吗?不能,除非重启。后端必须在会话开始时、导入 Keras 之前,在笔记本顶部设置一次。要切换后端,就需要完全重启会话。
运行代码需要高性能 GPU 吗?不需要。Colab 的免费版 GPU 运行时足以运行本书的全部代码;第8至18章使用 Colab Pro 的 GPU 会运行得更快。
各章涵盖哪些主题?内容从神经网络的数学基础讲起,涵盖分类、CNN 架构、图像分割与目标检测、时间序列预测、文本分类、Transformer,以及文本和图像生成。
这本书的旧版还有支持吗?有。第1版(2017年)和第2版(2021年)的旧版笔记本与当前的第3版笔记本并存保留。
Creator
fchollet
Size
7 MB
Stars
20.3K
Updated
CommitSep 18
Age
9y
Commits · 90 Days