概率编程

维基百科,自由的百科全书
跳到导航 跳到搜索

概率编程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]基于了JavaInfer.NET英语Infer.NET基于了.NET框架[12],而PRISM扩展自Prolog[13]。但是,一些PPL比如WinBUGS英语WinBUGSStan英语Stan (software),提供了独立的语言,没有明显起源自另一种语言[14][15]

一些PPL正在活跃开发中,包括在beta测试中的那些。两个最流行的工具是Stan和PyMC3[16]

关系[编辑]

概率关系编程语言(PRPL)专门设计来描述和推论概率关系模型英语Statistical relational learning#Representation formalisms(PRM)的概率编程语言(PPL)。

PRM的开发通常具有一组算法,用于关注的分布的归约、推理和发现,它们被嵌入到对应的PRPL中。

概率编程语言列表[编辑]

名字 扩展自 宿主语言
Analytica英语Analytica (software)[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英语B-Prolog
Infer.NET英语Infer.NET[12] .NET Framework .NET Framework
dimple[10] MATLAB, Java
chimple[11] MATLAB, Java
BLOG[27] Java
delSAT[28] 回答集编程, SAT (DIMACS CNF)
PSQL[29] SQL
BUGS[14]
FACTORIE[30] Scala Scala
PMTK[31] MATLAB MATLAB
Alchemy[32] C++
Dyna[33] Prolog
Figaro[34] Scala Scala
Church英语Church (programming language)[35] Scheme 各种: JavaScript, Scheme
ProbLog[36] Prolog Python, Jython
ProBT[37] C++, Python
Stan英语Stan (software)[15] C++
Hakaru[38] Haskell Haskell
BAli-Phy英语BAli-Phy [39] Haskell C++
ProbCog[40] Java, Python
Gamble[41] Racket
PWhile[42] While Python
Tuffy[43] Java
PyMC3[44] Python, Theano Python
PyMC4[45] Python, TensorFlow Probability Python
Rainier[46][47] Scala Scala
greta[48] TensorFlow R
pomegranate[49] Python Python
Lea[50] Python Python
WebPPL[51] JavaScript JavaScript
Let's Chance[52] Scratch JavaScript
Picture[4] Julia Julia
Turing.jl[53] Julia Julia
Gen[54] Julia Julia
低层一阶PPL[55] Python, Clojure, Pytorch 各种: Python, Clojure
Troll[56] Moscow ML
Edward[57] TensorFlow Python
TensorFlow Probability[58] TensorFlow Python
Edward2[59] TensorFlow Probability Python
Pyro[60] PyTorch Python
Saul[61] Scala Scala
Stan[62] C++, Python, R
RankPL[63] Java
Birch[64] C++
PSI[65] D

困难[编辑]

推理按概率分布的变量给初学编程者带来困难,但是这些困难可以通过使用嵌入到源代码编辑器中的变量分布的贝叶斯网络可视化和图来解决[66]

参见[编辑]

注释[编辑]

  1. ^ Probabilistic programming does in 50 lines of code what used to take thousands. phys.org. April 13, 2015 [2015-04-13]. 
  2. ^ Probabilistic Programming. probabilistic-programming.org. [December 24, 2013]. (原始内容存档于January 10, 2016). 
  3. ^ Pfeffer, Avrom (2014), Practical Probabilistic Programming, Manning Publications. p.28. ISBN 978-1 6172-9233-0
  4. ^ 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]. 
  5. ^ Hardesty, Larry. Graphics in reverse. April 13, 2015. 
  6. ^ MIT shows off machine-learning script to make CREEPY HEADS. 
  7. ^ MIT's Gen programming system flattens the learning curve for AI projects. VentureBeat. 2019-06-27 [2019-06-27] (美国英语). 
  8. ^ Predicting Drug-Induced Liver Injury with Bayesian Machine Learning, 2019 
  9. ^ ∂P: A Differentiable Programming System to Bridge Machine Learning and Scientific Computing, 2019, arXiv:1907.07587可免费查阅 
  10. ^ 10.0 10.1 Dimple Home Page. analog.com. 
  11. ^ 11.0 11.1 Chimple Home Page. analog.com. 
  12. ^ 12.0 12.1 Infer.NET. microsoft.com. Microsoft. 
  13. ^ 13.0 13.1 PRISM: PRogramming In Statistical Modeling. rjida.meijo-u.ac.jp. [July 8, 2015]. (原始内容存档于March 1, 2015). 
  14. ^ 14.0 14.1 The BUGS Project - MRC Biostatistics Unit. cam.ac.uk. [January 12, 2011]. (原始内容存档于March 14, 2014). 
  15. ^ 15.0 15.1 Stan. mc-stan.org. (原始内容存档于2012-09-03). 
  16. ^ The Algorithms Behind Probabilistic Programming. [2017-03-10]. 
  17. ^ Analytica-- A Probabilistic Modeling Language. lumina.com. 
  18. ^ bayesloop: Probabilistic programming framework that facilitates objective model selection for time-varying parameter models. 
  19. ^ GitHub -- bayesloop. 
  20. ^ Probabilistic Programming with CuPPL. popl19.sigplan.org. 
  21. ^ NOVA: A Functional Language for Data Parallelism. acm.org. 
  22. ^ Venture -- a general-purpose probabilistic programming platform. mit.edu. [September 20, 2014]. (原始内容存档于January 25, 2016). 
  23. ^ Probabilistic C. ox.ac.uk. [March 24, 2015]. (原始内容存档于January 4, 2016). 
  24. ^ The Anglican Probabilistic Programming System. ox.ac.uk. 
  25. ^ IBAL Home Page. (原始内容存档于December 26, 2010). 
  26. ^ BayesDB on SQLite. A Bayesian database table for querying the probable implications of data as easily as SQL databases query the data itself. GitHub. 
  27. ^ Bayesian Logic (BLOG). mit.edu. (原始内容存档于June 16, 2011). 
  28. ^ delSAT (probabilistic SAT/ASP). 
  29. ^ 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. 
  30. ^ Factorie - Probabilistic programming with imperatively-defined factor graphs - Google Project Hosting. google.com. 
  31. ^ PMTK3 - probabilistic modeling toolkit for Matlab/Octave, version 3 - Google Project Hosting. google.com. 
  32. ^ Alchemy - Open Source AI. washington.edu. 
  33. ^ Dyna. www.dyna.org. [January 12, 2011]. (原始内容存档于January 17, 2016). 
  34. ^ Charles River Analytics - Probabilistic Modeling Services. cra.com. 
  35. ^ Church. mit.edu. [April 8, 2013]. (原始内容存档于January 14, 2016). 
  36. ^ ProbLog: Probabilistic Programming. dtai.cs.kuleuven.be. 
  37. ^ ProbaYes. ProbaYes - Ensemble, nous valorisations vos données. probayes.com. [November 26, 2013]. (原始内容存档于March 5, 2016). 
  38. ^ Hakaru Home Page. hakaru-dev.github.io/. 
  39. ^ BAli-Phy Home Page. bali-phy.org. 
  40. ^ ProbCog. GitHub. 
  41. ^ Culpepper, Ryan. gamble: Probabilistic Programming. January 17, 2017 –通过GitHub. 
  42. ^ PWhile Compiler. GitHub. 
  43. ^ Tuffy: A Scalable Markov Logic Inference Engine. stanford.edu. 
  44. ^ PyMC devs. PyMC3. pymc-devs.github.io. 
  45. ^ Developers, PyMC. The Future of PyMC3, or: Theano is Dead, Long Live Theano. PyMC Developers. 2020-10-26 [2021-01-17]. PyMC4, which is based on TensorFlow, will not be developed further. 
  46. ^ stripe/rainier, Stripe, 2020-08-19 [2020-08-26] 
  47. ^ Rainier · Bayesian inference for Scala. samplerainier.com. [2020-08-26]. 
  48. ^ greta: simple and scalable statistical modelling in R. GitHub. [2018-10-02]. 
  49. ^ Home — pomegranate 0.10.0 documentation. pomegranate.readthedocs.io. [2018-10-02] (英语). 
  50. ^ Lea Home Page. bitbucket.org. 
  51. ^ WebPPL Home Page. github.com/probmods/webppl. 
  52. ^ Extended Abstracts of the 2020 CHI Conference on Human Factors in Computing Systems. dl.acm.org. [2020-08-01]. doi:10.1145/3334480.3383071 (英语). 
  53. ^ The Turing language for probabilistic programming. 
  54. ^ Gen: A General Purpose Probabilistic Programming Language with Programmable Inference. [2019-06-17]. 
  55. ^ LF-PPL: A Low-Level First Order Probabilistic Programming Language for Non-Differentiable Models. ox.ac.uk. 
  56. ^ Troll dice roller and probability calculator. 
  57. ^ Edward – Home. edwardlib.org. [2017-01-17]. 
  58. ^ TensorFlow. Introducing TensorFlow Probability. TensorFlow. 2018-04-11 [2018-10-02]. 
  59. ^ 'Edward2' TensorFlow Probability module. GitHub. [2018-10-02] (英语). 
  60. ^ Pyro. pyro.ai. [2018-02-09] (英语). 
  61. ^ CogComp - Home. 
  62. ^ Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation.. 
  63. ^ Rienstra, Tjitze, RankPL: A qualitative probabilistic programming language based on ranking theory, 2018-01-18 [2018-01-18] 
  64. ^ Probabilistic Programming in Birch. birch-lang.org. [2018-04-20]. 
  65. ^ PSI Solver - Exact inference for probabilistic programs. psisolver.org. [2019-08-18]. 
  66. ^ 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. 

外部链接[编辑]