Skip to Content
TinyML:基于TensorFlow Lite 在Arduino 和超低功耗微控制器上部署机器学习
book

TinyML:基于TensorFlow Lite 在Arduino 和超低功耗微控制器上部署机器学习

by Pete Warden, Daniel Situnayake
September 2020
Intermediate to advanced
434 pages
9h 6m
Chinese
China Machine Press
Content preview from TinyML:基于TensorFlow Lite 在Arduino 和超低功耗微控制器上部署机器学习
360
15
诸如 AutoML 之类的服务已经可以让用户避免许多烦琐的训练细节,希望这
种趋势会继续下去,这样你将能够更轻松地权衡精确度和运行效率,选择最
适合你的模型。
15.4 量化
运行神经网络需要为每个预测进行数十万甚至数百万次计算。大多数执行这种复杂计算
的程序对数值精度非常敏感。否则,错误会累积,导致结果误差过大而无法使用。深度
学习模型在这一点上非常不同
它能够应付中间计算期间数值精度的巨大损失,并且
仍然可以产生总体上准确的最终结果。这个属性似乎是其训练过程的副产品
在深度
网络的训练过程中,通常会输入大量噪声,因此模型学习了应对微小变化的鲁棒性,并
专注于学习数据中的重要模式。
这意味着,在实践中,使用 32 位浮点表示进行的操作几乎比推断所需的精度更高。32
位浮点的训练要求更高,因为它需要对权重进行许多小的更改才能学习,但即使这样,
16 位表示形式也被广泛使用。大多数推断应用程序仅使用 8 位存储权重和激活值,就可
以产生与浮点等效项几乎无差别的结果。这对于嵌入式应用程序来说是个好消息,许多
平台都对这些模型所依赖的 8 位乘法和累加指令提供了强大的支持,因为这些指令在信
号处理算法中非常常见。
不过,将模型从浮点数转换为 8 位数值并不容易。为了有效执行计算,8 位数值需要被
线性转换为实数。这对于权重来说很容易,因为我们可以根据训练后的值知道每一层的
范围,因此可以得出正确的缩放系数来执行转换。不过,这对于激活来说比较棘手,因
为通过检查模型参数和架构并不能清楚地得到每层输出的实际范围。如果选择的范围太 ...
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版)

Peter Bruce, Andrew Bruce, Peter Gedeck
程序设计导论:Python语言实践

程序设计导论:Python语言实践

罗伯特 塞奇威克, 凯文 韦恩, 罗伯特 唐德罗
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普
Python程序设计:人工智能案例实践

Python程序设计:人工智能案例实践

保罗 戴特尔, 哈维 戴特尔

Publisher Resources

ISBN: 9787111664222