本书由 Keras 之父、现任 Google 人工智能研究员的弗朗索瓦 • 肖莱(François Chollet)执笔,详尽介 绍了用 Python 和 Keras 进行深度学习的探索实践,涉及计算机视觉、自然语言处理、生成式模型等应用。 书中包含 30 多个代码示例,步骤讲解详细透彻。由于本书立足于人工智能的可达性和大众化,读者无须 具备机器学习相关背景知识即可展开阅读。在学习完本书后,读者将具备搭建自己的深度学习环境、建立 图像识别模型、生成图像和文字等能力。 本书适合从事大数据及机器学习领域工作,并对深度学习感兴趣的各类读者。
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
【One-Line Pitch】
A hands-on, code-first introduction to deep learning by the creator of Keras, teaching you to build image classifiers, text processors, and generative models with Python—ideal for developers and data professionals who want to move from theory to working neural networks without a heavy math background.
【Book Arc】
- **Opening (~0%–10%)**: Sets the stage with the history and concepts of AI, machine learning, and deep learning, explaining why deep learning works (layered representations, joint learning) and what it can achieve today—from image classification to game playing—while cautioning against hype.
- **Early (~10%–23%)**: Builds the mathematical foundation: tensors, tensor operations, gradient descent, and backpropagation, using a first MNIST example to make abstract concepts concrete and intuitive.
- **Early–Middle (~23%–39%)**: Moves into practical neural network building with Keras, covering binary classification (movie reviews), multiclass classification (news wires), and scalar regression (housing prices), plus essential workflows like preprocessing, validation, and K-fold cross-validation.
- **Middle (~39%–48%)**: Introduces the standard machine learning workflow—defining problems, choosing metrics, and fighting overfitting—then dives into computer vision with convolutional neural networks (CNNs), including training on small datasets and using data augmentation.
- **Late (~48%–60%)**: Explores advanced vision techniques: using pretrained networks (VGG16) for feature extraction and fine-tuning, plus visualizing what CNNs learn—key strategies for real-world small-data problems.
- **Ending (~60%–100%)**: Covers sequence data (text, time series) with RNNs and 1D CNNs, advanced model-building techniques, generative models (image and text creation), and a concluding look at deep learning's limitations and future—though excerpts only partially cover these later chapters.
【Key Takeaways】
- **Deep learning = learning representations** (Early): Models transform data through successive layers, each a simple geometric transformation, jointly learned to make data more separable—this is why deep nets beat shallow methods on perception tasks.
- **Tensors and gradient descent are the engine** (Early): All neural nets operate on tensors (multi-dimensional arrays) with operations like broadcasting; training is a loop of forward pass, loss computation, and weight updates via gradient descent.
- **Backpropagation is just the chain rule** (Early): Modern frameworks like TensorFlow handle symbolic differentiation automatically, so you don't implement backprop manually—but understanding it clarifies how weights get adjusted.
- **Choose loss functions wisely** (Early): Binary crossentropy for binary classification, categorical crossentropy for multiclass, MSE for regression; a poorly chosen objective can lead to unintended, even harmful, model behavior.
- **Overfitting is the core challenge** (Middle): Models with too many parameters memorize rather than generalize; reduce capacity, use regularization, and always evaluate on validation data, not test data.
- **The universal ML workflow** (Middle): Define the problem and data, pick success metrics aligned with your goal, preprocess features, and iterate on architecture—remembering that ML only finds patterns present in training data.
- **Pretrained networks are a small-data superpower** (Late): Using a network trained on ImageNet (like VGG16) for feature extraction or fine-tuning dramatically boosts accuracy on small datasets, making transfer learning a practical default.
- **Data augmentation fights overfitting in vision** (Late): Generating transformed versions of training images (shifts, flips, zooms) effectively increases dataset size and improves generalization for CNNs.
【Reading Tips】
- **Skim the history and hype sections** (Chapter 1): The first ~10% is motivational context; you can read it quickly and focus on the "why deep learning works" part (layered representations) before moving to math.
- **Deep-read the math chapter (Chapter 2)**: Tensor operations, broadcasting, and gradient descent are the foundation for everything else; work through the MNIST example even if code feels magical—it's revisited later.
- **Code along with Chapter 3**: The three examples (binary classification, multiclass, regression) are templates for most problems; type them out, run them, and tweak parameters to build intuition for overfitting and validation.
- **Treat Chapter 5 as a practical playbook**: For vision, focus on the small-dataset workflow (data augmentation, pretrained features, fine-tuning); these techniques transfer directly to real projects with limited data.
- **Watch for the "universal workflow" in Chapter 4**: This is the book's meta-lesson—a reusable template for defining, evaluating, and solving any ML problem; internalize it before moving to advanced topics.
【Coverage Limits】
This guide is based on excerpts covering roughly the first half of the book (through Chapter 5 on computer vision). Later chapters on sequence processing (RNNs), advanced techniques, generative models, and the conclusion are only partially represented in the source material.
Page 12
度学习工作站 的更多信息。 如果你没有已安装最新 NVIDIA GPU 的本地工作站,那么可以使用云环境,特别推荐谷歌 云实例(比如带有 NVIDIA Tesla K80 扩展的 n1-standard-8 实例)或亚马逊网络服务(AWS)的 GPU 实例(比如 p2.xlarge 实例)。附录 B 详细介绍了一...
View in text
Excerpt 2
它来验证你的算法是否按预期运行。当你成为机器学习从业者后,会发现 MNIST 一次又一次地出现在科学论文、博客文章等中。图 2-1 给出了 MNIST 数据集的一些样本。 2.2 神经网络的数据表示 25 >>> x = np.array([[[5, 78, 2, 34, 0], [6, 79, 3, 35,...
View in text
Excerpt 3
据中留出 1000 个样本作为验证集。 代码清单 3-17 留出验证集 x_val = x_train[:1000] partial_x_train = x_train[1000:] y_val = one_hot_train_labels[:1000] partial_y_train = one_hot_tra...
View in text
Excerpt 4
= os.path.join(original_dataset_dir, fname) 将前 1000 张猫的图像复制 dst = os.path.join(train_cats_dir, fname) 到 train_cats_dir shutil.copyfile(src, dst) 4 fnames = [...
View in text
Excerpt 5
dense_4 (Dense) (None, 1) 513 Total params: 3,453,121 Trainable params: 3,453,121 Non-trainable params: 0 9 136 第 5 章 深度学习用于计算机视觉 这里需要注意以下几点。 第一层是各种边缘探测器的集...
View in text
Excerpt 6
blem),这一效应类似于 在层数较多的非循环网络(即前馈网络)中观察到的效应:随着层数的增加,网络最终变得无 法训练。Hochreiter、Schmidhuber 和 Bengio 在 20 世纪 90 年代初研究了这一效应的理论原因 a。 LSTM层和 GRU层都是为了解决这个问题而设计的。 先来看 LSTM...
View in text
Excerpt 7
;但在底层,你需要构建相当复杂的图 结构来使其生效。其中许多内容都与梯度下降过程有关。你所见到的内容与你所操作的内容之 间存在这种复杂度差异,这正是你选择使用 Keras 来构建模型、而不是使用原始 TensorFlow 从 头开始定义所有内容的主要动机。Keras 让工作流程变得非常简单。 7.3 让模型性能发...
View in text
Excerpt 8
知道想要实现的目标是什么,就是保存 原始图像的内容,同时采用参考图像的风格。如果我们能够在数学上给出内容和风格的定义, 那么就有一个适当的损失函数(如下所示),我们将对其进行最小化。 loss = distance(style(reference_image) - style(generated_image))...
View in text
Tags
AI categories
Artificial IntelligencePythonProgramming
Text Preview (First 20 pages)
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Generating text preview…
Loading comments...
Reply to Comment
Edit Comment