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 版)
大规模训练和部署
TensorFlow
模型
|
599
例如,在图 19-14 中,操作 A、B 和 C 是源操作,因此可以立即对其进行评估。操作 A
和 B 被放置在 CPU 上,因此它们被发送到 CPU 的评估队列,然后被分派到互操作线程
池并立即进行并行评估。操作 A 碰巧有一个多线程内核。它的计算分为三部分,由内操
作线程池以并行方式执行。操作 C 进入 GPU 0 的评估队列,在此示例中,其 GPU 内核
恰好使用 cuDNN,该 cuDNN 管理其自己的内操作线程池并跨多个 GPU 线程并行运行
该操作。假设 C 首先完成。D 和 E 的依赖计数器递减,它们达到零,因此这两个操作都
被推入 GPU 0 的评估队列,并依次执行。请注意即使 D 和 E 都依赖 C,C 只会被评估一
次。假设 B 接下来完成。F 的依赖计数器从 4 减少到 3,并且由于它不是 0,所以它还不
会运行。一旦 A、D 和 E 完成,则 F 的依赖计数器达到 0,则将其推入 CPU 的评估队列
并进行评估。最后,TensorFlow 返回请求的输出。
当 TF 函数修改有状态资源(例如变量)时,TensorFlow 会执行额外的操作:即使语句
之间没有明显的依赖关系,它也可以确保执行顺序与代码中的顺序匹配。例如,如果你
的 TF 函数包含 v.assign_add(1),再跟一条 v.assign(v
*
2),TensorFlow 将确
保按照这些顺序执行这些操作。
你可以通过调用tf.config.threading.set_inter_op_parallelism_ ...
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