Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
使用卷积神经网络的深度计算机视觉
417
model.add(ResidualUnit(filters, strides=strides))
prev_filters = filters
model.add(keras.layers.GlobalAvgPool2D())
model.add(keras.layers.Flatten())
model.add(keras.layers.Dense(10, activation="softmax"))
这段代码中唯一有点技巧的部分是将 ResidualUnit 层添加到模型的循环:如前所述,
3 RU 具有 64 个滤波器,然后余下 4 RU 具有 128 个滤波器,以此类推。然后,
当滤波器的数量与上一个 RU 中的相同时,将步幅设置为 1,否则将其设置为 2。然后添
ResidualUnit,最后更新 prev_filters
令人惊讶的是,我们可以用不到 40 行代码来构建赢得 2015 ILSVRC 挑战的模型!这
证明了 ResNet 模型的优雅和 Keras API 的表达力。实现其他 CNN 架构并不困难。但是,
Keras 内置了其中几种架构,那么为什么不使用它们呢?
14.6 使用 Keras 的预训练模型
通常,你无须手动实现像 GoogLeNet ResNet 这样的标准模型,因为在 keras.
applications 包中只需一行代码即可轻松获得预训练的网络。例如,你可以使用以
下代码加载在 ImageNet ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
Go语言编程

Go语言编程

威廉·肯尼迪
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977