概率编程
概率编程(PP)是一种编程范型,在其中指定了概率模型并自动进行这些模型的推断[1]。它代表了统一概率模型和传统通用编程的一种尝试,使前者更加容易并更广泛的应用[2][3]。它可以用于建立系统帮助在面对不确定时作出决定。
用于概率编程的编程语言被称为“概率编程语言”(PPL)。
应用
概率推理已经广泛用于各种任务,比如预测股价、推荐电影、诊断计算机、检测网络入侵和图像检查[4]。但是直到最近(部分由于计算能力的限制),概率编程范围有限,并且多数推断算法对每个任务都必须手工编写。
尽管如此,在2015年一个50行的概率计算机视觉程序被用于基于人脸的2D图像来生成这些人脸的3D模型。这个程序使用反向(inverse)图作为推断方法的基础,并使用Julia的Picture包来建造[4]。这使得“用50行代码写出过去千行代码的程序”成为可能[5][6]。Gen概率编程库(也用Julia写成)已经被用于视觉和机器人任务[7]。
最近,概率编程系统Turing.jl已经被用于各种制药和经济应用[8]。Julia中的概率编程已经结合于可微分编程,通过组合Julia包Zygote.jl和Turing.jl[9]。
概率编程语言
概率编程语言(PPL)经常从基础语言扩展而来。底层基础语言的选择依赖于模型与基础语言本体的类似性,还有商业考虑和个人偏好。例如Dimple[10]和Chimple[11]基于了Java,Infer.NET基于了.NET框架[12],而PRISM扩展自Prolog[13]。但是,一些PPL比如WinBUGS和Stan,提供了独立的语言,没有明显起源自另一种语言[14][15]。
一些PPL正在活跃开发中,包括在beta测试中的那些。两个最流行的工具是Stan和PyMC[16]。
关系
概率关系编程语言(PRPL)专门设计来描述和推论概率关系模型(PRM)的概率编程语言(PPL)。
PRM的开发通常具有一组算法,用于关注的分布的归约、推理和发现,它们被嵌入到对应的PRPL中。
概率编程语言列表
名字 | 扩展自 | 宿主语言 |
---|---|---|
Analytica[17] | C++ | |
bayesloop[18][19] | Python | Python |
CuPPL[20] | NOVA[21] | |
Venture[22] | Scheme | C++ |
Probabilistic-C[23] | C | C |
Anglican[24] | Clojure | Clojure |
IBAL[25] | OCaml | |
BayesDB[26] | SQLite, Python | |
PRISM[13] | B-Prolog | |
Infer.NET[12] | .NET Framework | .NET Framework |
dimple[10] | MATLAB, Java | |
chimple[11] | MATLAB, Java | |
BLOG[27] | Java | |
diff-SAT[28] | 回答集编程, SAT (DIMACS CNF) | |
PSQL[29] | SQL | |
BUGS[14] | Pascal | |
FACTORIE[30] | Scala | Scala |
PMTK[31] | MATLAB | MATLAB |
Alchemy[32] | C++ | |
Dyna[33] | Prolog | |
Figaro[34] | Scala | Scala |
Church[35] | Scheme | 各种: JavaScript, Scheme |
ProbLog[36] | Prolog | Python |
ProBT[37] | C++, Python | |
Stan[15] | BUGS | C++ |
Hakaru[38] | Haskell | Haskell |
BAli-Phy (软件)[39] | Haskell | C++ |
ProbCog[40] | Java, Python | |
Gamble[41] | Racket | |
PWhile[42] | While | Python |
Tuffy[43] | Java | |
PyMC[44] | Python | Python |
Rainier[45][46] | Scala | Scala |
greta[47] | TensorFlow | R |
pomegranate[48] | Python | Python |
Lea[49] | Python | Python |
WebPPL[50] | JavaScript | JavaScript |
Let's Chance[51] | Scratch | JavaScript |
Picture[4] | Julia | Julia |
Turing.jl[52] | Julia | Julia |
Gen[53] | Julia | Julia |
Low-level First-order PPL[54] | Python, Clojure, Pytorch | 各种: Python, Clojure |
Troll[55] | Moscow ML | |
Edward[56] | TensorFlow | Python |
TensorFlow Probability[57] | TensorFlow | Python |
Edward2[58] | TensorFlow Probability | Python |
Pyro[59] | PyTorch | Python |
NumPyro[60] | JAX | Python |
Saul[61] | Scala | Scala |
Stan[62] | C++, Python, R | |
RankPL[63] | Java | |
Birch[64] | C++ | |
PSI[65] | D | |
Blang[66] |
困难
推理按概率分布的变量给初学编程者带来困难,但是这些困难可以通过使用嵌入到源代码编辑器中的变量分布的贝叶斯网络可视化和图来解决[67]。
参见
- 统计关系学习
- 归纳编程
- 贝叶斯编程
注释
- ^ Probabilistic programming does in 50 lines of code what used to take thousands. phys.org. April 13, 2015 [2015-04-13]. (原始内容存档于2021-01-28).
- ^ Probabilistic Programming. probabilistic-programming.org. [December 24, 2013]. (原始内容存档于January 10, 2016).
- ^ Pfeffer, Avrom (2014), Practical Probabilistic Programming, Manning Publications. p.28. ISBN 978-1 6172-9233-0
- ^ 4.0 4.1 4.2 Short probabilistic programming machine-learning code replaces complex programs for computer-vision tasks. KurzweilAI. April 13, 2015 [27 Nov 2017]. (原始内容存档于2021-02-12).
- ^ Hardesty, Larry. Graphics in reverse. April 13, 2015 [2021-01-16]. (原始内容存档于2021-01-22).
- ^ MIT shows off machine-learning script to make CREEPY HEADS. [2021-01-16]. (原始内容存档于2019-09-20).
- ^ MIT's Gen programming system flattens the learning curve for AI projects. VentureBeat. 2019-06-27 [2019-06-27]. (原始内容存档于2021-01-24) (美国英语).
- ^ Predicting Drug-Induced Liver Injury with Bayesian Machine Learning, 2019 [2021-01-16], (原始内容存档于2020-08-06)
- ^ ∂P: A Differentiable Programming System to Bridge Machine Learning and Scientific Computing, 2019, arXiv:1907.07587
- ^ 10.0 10.1 Dimple Home Page. analog.com. July 2, 2021.
- ^ 11.0 11.1 Chimple Home Page. analog.com. April 16, 2021.
- ^ 12.0 12.1 Infer.NET. microsoft.com. Microsoft.
- ^ 13.0 13.1 PRISM: PRogramming In Statistical Modeling. rjida.meijo-u.ac.jp. [July 8, 2015]. (原始内容存档于March 1, 2015).
- ^ 14.0 14.1 The BUGS Project - MRC Biostatistics Unit. cam.ac.uk. [January 12, 2011]. (原始内容存档于March 14, 2014).
- ^ 15.0 15.1 Stan. mc-stan.org. (原始内容存档于2012-09-03).
- ^ The Algorithms Behind Probabilistic Programming. [2017-03-10]. (原始内容存档于2021-01-29).
- ^ Analytica-- A Probabilistic Modeling Language. lumina.com.
- ^ bayesloop: Probabilistic programming framework that facilitates objective model selection for time-varying parameter models.
- ^ GitHub -- bayesloop. GitHub. December 7, 2021.
- ^ Probabilistic Programming with CuPPL. popl19.sigplan.org.
- ^ NOVA: A Functional Language for Data Parallelism. acm.org. Array'14. June 9, 2014: 8–13. ISBN 9781450329378. S2CID 6748967. doi:10.1145/2627373.2627375.
- ^ Venture -- a general-purpose probabilistic programming platform. mit.edu. [September 20, 2014]. (原始内容存档于January 25, 2016).
- ^ Probabilistic C. ox.ac.uk. [March 24, 2015]. (原始内容存档于January 4, 2016).
- ^ The Anglican Probabilistic Programming System. ox.ac.uk. January 6, 2021.
- ^ IBAL Home Page. (原始内容存档于December 26, 2010).
- ^ BayesDB on SQLite. A Bayesian database table for querying the probable implications of data as easily as SQL databases query the data itself. GitHub. December 26, 2021.
- ^ Bayesian Logic (BLOG). mit.edu. (原始内容存档于June 16, 2011).
- ^ diff-SAT (probabilistic SAT/ASP). GitHub. October 8, 2021.
- ^ Dey, Debabrata; Sarkar, Sumit. PSQL: A query language for probabilistic relational data. Data & Knowledge Engineering. 1998, 28: 107–120. doi:10.1016/S0169-023X(98)00015-9.
- ^ Factorie - Probabilistic programming with imperatively-defined factor graphs - Google Project Hosting. google.com.
- ^ PMTK3 - probabilistic modeling toolkit for Matlab/Octave, version 3 - Google Project Hosting. google.com.
- ^ Alchemy - Open Source AI. washington.edu.
- ^ Dyna. www.dyna.org. [January 12, 2011]. (原始内容存档于January 17, 2016).
- ^ Charles River Analytics - Probabilistic Modeling Services. cra.com. February 9, 2017.
- ^ Church. mit.edu. [April 8, 2013]. (原始内容存档于January 14, 2016).
- ^ ProbLog: Probabilistic Programming. dtai.cs.kuleuven.be.
- ^ ProbaYes. ProbaYes - Ensemble, nous valorisations vos données. probayes.com. [November 26, 2013]. (原始内容存档于March 5, 2016).
- ^ Hakaru Home Page. hakaru-dev.github.io/.
- ^ BAli-Phy Home Page. bali-phy.org.
- ^ ProbCog. GitHub.
- ^ Culpepper, Ryan. gamble: Probabilistic Programming. January 17, 2017 –通过GitHub.
- ^ PWhile Compiler. GitHub. May 25, 2020.
- ^ Tuffy: A Scalable Markov Logic Inference Engine. stanford.edu.
- ^ PyMC devs. PyMC. pymc-devs.github.io.
- ^ stripe/rainier, Stripe, 2020-08-19 [2020-08-26], (原始内容存档于2021-02-19)
- ^ Rainier · Bayesian inference for Scala. samplerainier.com. [2020-08-26].
- ^ greta: simple and scalable statistical modelling in R. GitHub. [2018-10-02]. (原始内容存档于2018-10-03).
- ^ Home — pomegranate 0.10.0 documentation. pomegranate.readthedocs.io. [2018-10-02]. (原始内容存档于2021-01-22) (英语).
- ^ Lea Home Page. bitbucket.org.
- ^ WebPPL Home Page. github.com/probmods/webppl.
- ^ Let's Chance: Playful Probabilistic Programming for Children | Extended Abstracts of the 2020 CHI Conference on Human Factors in Computing Systems. dl.acm.org. Chi Ea '20. April 25, 2020: 1–7 [2020-08-01]. ISBN 9781450368193. S2CID 216079395. doi:10.1145/3334480.3383071. (原始内容存档于2021-01-22) (英语).
- ^ The Turing language for probabilistic programming. GitHub. December 28, 2021.
- ^ Gen: A General Purpose Probabilistic Programming Language with Programmable Inference. [2019-06-17]. (原始内容存档于2020-11-12).
- ^ LF-PPL: A Low-Level First Order Probabilistic Programming Language for Non-Differentiable Models. ox.ac.uk. November 2, 2019.
- ^ Troll dice roller and probability calculator.
- ^ Edward – Home. edwardlib.org. [2017-01-17]. (原始内容存档于2020-11-08).
- ^ TensorFlow. Introducing TensorFlow Probability. TensorFlow. 2018-04-11 [2018-10-02]. (原始内容存档于2021-01-22).
- ^ 'Edward2' TensorFlow Probability module. GitHub. [2018-10-02]. (原始内容存档于2020-01-08) (英语).
- ^ Pyro. pyro.ai. [2018-02-09]. (原始内容存档于2021-01-19) (英语).
- ^ NumPyro. pyro.ai. [2021-07-23]. (原始内容存档于2022-10-31) (英语).
- ^ CogComp - Home. [2021-01-16]. (原始内容存档于2018-01-16).
- ^ Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation. [2021-01-16]. (原始内容存档于2021-04-02).
- ^ Rienstra, Tjitze, RankPL: A qualitative probabilistic programming language based on ranking theory, 2018-01-18 [2018-01-18], (原始内容存档于2020-11-09)
- ^ Probabilistic Programming in Birch. birch-lang.org. [2018-04-20]. (原始内容存档于2021-01-29).
- ^ PSI Solver - Exact inference for probabilistic programs. psisolver.org. [2019-08-18]. (原始内容存档于2021-01-23).
- ^ Blang Homepage. [2022-08-31]. (原始内容存档于2021-05-10).
- ^ Gorinova, Maria I.; Sarkar, Advait; Blackwell, Alan F.; Syme, Don. A Live, Multiple-Representation Probabilistic Programming Environment for Novices. Proceedings of the 2016 CHI Conference on Human Factors in Computing Systems. CHI '16 (New York, NY, USA: ACM). 2016-01-01: 2533–2537. ISBN 9781450333627. doi:10.1145/2858036.2858221.