Skip to Content
R概率图模型入门与实践
book

R概率图模型入门与实践

by Posts & Telecom Press, David Bellot
May 2024
Intermediate to advanced
202 pages
3h 12m
Chinese
Packt Publishing
Content preview from R概率图模型入门与实践

第5章 近似推断

这一章会介绍第二类推断算法。得益于它的广泛性,它也许是最重要的算法。它的方法与之前学习到的完全不同。其实,我们已经看到了两类算法:一类是基于纯解析的,通过手动计算后验概率分布的方案;另一类是使用图模型中的信息传递的方案。两种情形的结果都是精确的。对于解析的方案,计算过程通常分解为计算后验概率的函数。对于信息传递的算法,计算后验概率可以通过图中的信息传递逐步实现。如果图形不适合这一类算法,计算过程会变得非常耗时,且难以控制。

但是在许多情况下,我们经常用精度换速度,这就是近似推断的主要思想。如果没有那么精确,是否影响很大?然而,在多数问题中,近似推理依然很精确。另一方面,它允许我们处理带有许多不同分布的更加复杂的模型。这类模型通常让其他方法变得完全不可行。

我们会在这一章使用一类重要的算法,即采样算法(Sampling Algorithms),也叫作蒙特卡洛采样(Monte-Carlo Sampling)。其主要思想是从后验分布中随机抽出数据,以便使用简单的统计代替复杂的计算。例如,如果我们想计算一个随机变量的后验概率平均值,我们可以从后验分布中随机抽取许多样本,然后计算这些样本的平均值。

蒙特卡洛采样使得贝叶斯方案在科学研究中的应用成为可能。以前,贝叶斯模型难以计算,甚至无法计算。

具体说来,我们会介绍下列算法:

  • 拒绝采样和重要度采样。它们是许多其他模型的基础。
  • 马尔科夫链蒙特卡洛(Markov Chain Monte-Carlo)和Metropolis-Hastings算法。

这两个算法会涵盖蒙特卡洛方法的大部分知识。而今,许多新的算法也逐渐被提出。

通常概率图模型有一个比较大的问题:难以控制。概率图模型会变得非常复杂,以至于无法在合理的时间内运行任何逻辑,更不用说学习模型了。对于期望最大化这类简单的算法,我们需要计算每次迭代的后验概率。如果像当今的情况,数据集太大,模型又有许多维度,那么该算法也变得无法使用。而且,我们还只是局限在一小类分布上,例如多项式分布或者高斯分布。尽管它们可以涵盖大量的应用,但是并不是任何问题都是如此。 ...

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
神经网络算法与Java编程

神经网络算法与Java编程

Posts & Telecom Press, Fabio M. Soares, Alan M. F. Souza
TensorFlow深度学习项目实战

TensorFlow深度学习项目实战

Posts & Telecom Press, Luca Massaron, Alberto Boschetti, Alexey Grigorev, Abhishek Thakur
Kafka权威指南(第2版)

Kafka权威指南(第2版)

Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty

Publisher Resources

ISBN: 9781836201991