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 版)
360
12
TensorFlow 只能捕获在张量或数据集上迭代的 for 循环。因此请确保你使用 for
i
in
tf.range(x),而不是使用 for
i
in
range(x),否则这个循环不会在图中被捕
获。相反它会在跟踪过程中运行(也许这就是你想要的,如果要使用 for循环来构
建图形,例如在神经网络中创建每一层)。
与通常一样,出于性能原因,应尽可能使用向量化实现,而不是使用循环。
是时候总结了!在本章中,我们首先对 TensorFlow 进行了简要概述,然后介绍了
TensorFlow 的底层 API,包括张量、操作、变量和特殊数据结构。然后我们使用这些工
具自定义 tf.keras 中的几乎每个组件。最后,我们研究了 TF 函数如何提高性能,如何使
用自动图和跟踪来生成计算图以及编写 TF 函数时应遵循的规则(如果你想进一步打开
黑箱子,例如浏览生成的图形,可以在附录 G 中找到技术细节)。
在第 13 章中,我们将研究如何使用 TensorFlow 有效地加载和预处理数据。
12.5 练习题
1. 如何用一句话形容 TensorFlow ?它的主要特点是什么?你可以说出其他流行的深度
学习库吗?
2. TensorFlow 是否可以简单替代 NumPy ?两者之间的主要区别是什么?
3. 使用tf.range(10) tf.constant(np.ara
nge(10)) 是否会得到相同的
结果?
4. 除了常规张量之外,你还能说出 TensorFlow 中可用的其他 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

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

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

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977