Skip to Content
数据压缩入门
book

数据压缩入门

by Colt McAnlis, Aleks Haecky
April 2020
Intermediate to advanced
210 pages
4h 47m
Chinese
Posts & Telecom Press
Content preview from 数据压缩入门
突破熵
|
19
对最后一列求和,得到
–1.8455
(允许有些小
误差
)。求熵公式的最前面还有一个负号(即
求和符号
∑
前面的那个负号),因此得出结论:表示这组数据每个符号平均约需要
1.8455
个二进制位。搞定!
3.2
 熵有什么用处呢
因为
G
=
[A,B,B,C,C,C,D,D,D,D]
的熵
H
(
G
) ≈ 1.8455
,所以我们可以大致认为平均每个值用
2
个二进制位(通过向上取整运算获得)就可以对
G
进行编码。
可以像下面这样赋给每个符号
2
个二进制位的编码值:
A
-
> 00
B
-
> 01
C
-
> 10
D
-
> 11
这样一来,用二进制编码表示的
G
e
就会是下面这样:
e
=
[00,01,01,10,10,10,11,11,11,11]
这样编码之后,得到的
G
e
大小就是
20
个二进制位(在大多数教科书中表示为
|
G
e
|
)。
下面是很有趣的部分:为了得出
G
e
的最终大小,实际上不需要进行编码这一步,只需要
将熵
H
的值向上取整
5
再乘以
G
的长度(即
|
G
|
)就能得出结果:
H
(
G
)
×
|
G
|
=
2
×
10
=
20
个二进制位
=
|
G
e
|
根据香农的熵的定义,这就是表示这一数据集所需要的最小二进制位数
6
。
因此,总结起来就是,为了使表示某个数据集所需的二进制位数最少,数据集中的每个符
号平均所需的最小二进制位数就是熵。
3.3
 理解概率
从本质上来说,香农所定义的熵,是以一种倒排序的方式建立在数据流中每个符号出现概
率的估算之上的。
总的来说,一个符号出现得越频繁,它对整个数据集包含的信息内容的贡献就会越少,这
看起来似乎完全违背直觉。 ...
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

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
解密金融数据

解密金融数据

Justin Pauley
神经网络算法与Java编程

神经网络算法与Java编程

Posts & Telecom Press, Fabio M. Soares, Alan M. F. Souza

Publisher Resources

ISBN: 9787115534170