概率编程

概率编程PPProbabilistic programming)是一种编程范型,在其中指定了概率模型并自动进行这些模型的推断[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和PyMC[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
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英语Church (programming language)[35] Scheme 各种: JavaScript, Scheme
ProbLog英语ProbLog[36] Prolog Python
ProBT[37] C++, Python
Stan英语Stan (software)[15] BUGS 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
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]
MultiVerse[67] Python Python

困难

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

参见

注释

  1. ^ Probabilistic programming does in 50 lines of code what used to take thousands. phys.org. April 13, 2015 [2015-04-13]. (原始内容存档于2021-01-28). 
  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]. (原始内容存档于2021-02-12). 
  5. ^ Hardesty, Larry. Graphics in reverse. April 13, 2015 [2021-01-16]. (原始内容存档于2021-01-22). 
  6. ^ MIT shows off machine-learning script to make CREEPY HEADS. [2021-01-16]. (原始内容存档于2019-09-20). 
  7. ^ MIT's Gen programming system flattens the learning curve for AI projects. VentureBeat. 2019-06-27 [2019-06-27]. (原始内容存档于2021-01-24) (美国英语). 
  8. ^ Predicting Drug-Induced Liver Injury with Bayesian Machine Learning, 2019 [2021-01-16], (原始内容存档于2020-08-06) 
  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. July 2, 2021 [2021-01-16]. (原始内容存档于2020-10-14). 
  11. ^ 11.0 11.1 Chimple Home Page. analog.com. April 16, 2021 [2021-01-16]. (原始内容存档于2020-11-07). 
  12. ^ 12.0 12.1 Infer.NET. microsoft.com. Microsoft. [2021-01-16]. (原始内容存档于2016-12-06). 
  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]. (原始内容存档于2021-01-29). 
  17. ^ Analytica-- A Probabilistic Modeling Language. lumina.com. [2021-01-16]. (原始内容存档于2021-01-28). 
  18. ^ bayesloop: Probabilistic programming framework that facilitates objective model selection for time-varying parameter models. [2021-01-16]. (原始内容存档于2020-12-01). 
  19. ^ GitHub -- bayesloop. GitHub. December 7, 2021 [2021-01-16]. (原始内容存档于2020-09-28). 
  20. ^ Probabilistic Programming with CuPPL. popl19.sigplan.org. [2021-01-16]. (原始内容存档于2019-01-21). 
  21. ^ 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. 
  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. January 6, 2021 [2021-01-16]. (原始内容存档于2020-10-26). 
  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. December 26, 2021 [2021-01-16]. (原始内容存档于2020-09-21). 
  27. ^ Bayesian Logic (BLOG). mit.edu. (原始内容存档于June 16, 2011). 
  28. ^ diff-SAT (probabilistic SAT/ASP). GitHub. October 8, 2021 [2022-08-31]. (原始内容存档于2023-04-25). 
  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. [2021-01-16]. (原始内容存档于2012-04-14). 
  31. ^ PMTK3 - probabilistic modeling toolkit for Matlab/Octave, version 3 - Google Project Hosting. google.com. [2021-01-16]. (原始内容存档于2011-04-10). 
  32. ^ Alchemy - Open Source AI. washington.edu. [2021-01-16]. (原始内容存档于2008-06-16). 
  33. ^ Dyna. www.dyna.org. [January 12, 2011]. (原始内容存档于January 17, 2016). 
  34. ^ Charles River Analytics - Probabilistic Modeling Services. cra.com. February 9, 2017. 
  35. ^ Church. mit.edu. [April 8, 2013]. (原始内容存档于January 14, 2016). 
  36. ^ ProbLog: Probabilistic Programming. dtai.cs.kuleuven.be. [2021-01-16]. (原始内容存档于2020-11-08). 
  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/. [2021-01-16]. (原始内容存档于2020-11-08). 
  39. ^ BAli-Phy Home Page. bali-phy.org. [2021-01-16]. (原始内容存档于2021-03-22). 
  40. ^ ProbCog. GitHub. [2021-01-16]. (原始内容存档于2020-11-29). 
  41. ^ Culpepper, Ryan. gamble: Probabilistic Programming. January 17, 2017 [2021-01-16]. (原始内容存档于2020-11-06) –通过GitHub. 
  42. ^ PWhile Compiler. GitHub. May 25, 2020 [2021-01-16]. (原始内容存档于2020-10-17). 
  43. ^ Tuffy: A Scalable Markov Logic Inference Engine. stanford.edu. [2021-01-16]. (原始内容存档于2020-07-22). 
  44. ^ PyMC devs. PyMC. pymc-devs.github.io. [2022-08-31]. (原始内容存档于2022-05-16). 
  45. ^ stripe/rainier, Stripe, 2020-08-19 [2020-08-26], (原始内容存档于2021-02-19) 
  46. ^ Rainier · Bayesian inference for Scala. samplerainier.com. [2020-08-26]. [失效链接]
  47. ^ greta: simple and scalable statistical modelling in R. GitHub. [2018-10-02]. (原始内容存档于2018-10-03). 
  48. ^ Home — pomegranate 0.10.0 documentation. pomegranate.readthedocs.io. [2018-10-02]. (原始内容存档于2021-01-22) (英语). 
  49. ^ Lea Home Page. bitbucket.org. [2021-01-16]. (原始内容存档于2021-01-21). 
  50. ^ WebPPL Home Page. github.com/probmods/webppl. [2021-01-16]. (原始内容存档于2020-12-29). 
  51. ^ 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) (英语). 
  52. ^ The Turing language for probabilistic programming. GitHub. December 28, 2021. 
  53. ^ Gen: A General Purpose Probabilistic Programming Language with Programmable Inference. [2019-06-17]. (原始内容存档于2020-11-12). 
  54. ^ LF-PPL: A Low-Level First Order Probabilistic Programming Language for Non-Differentiable Models. ox.ac.uk. November 2, 2019. 
  55. ^ Troll dice roller and probability calculator. [2021-01-16]. (原始内容存档于2021-01-25). 
  56. ^ Edward – Home. edwardlib.org. [2017-01-17]. (原始内容存档于2020-11-08). 
  57. ^ TensorFlow. Introducing TensorFlow Probability. TensorFlow. 2018-04-11 [2018-10-02]. (原始内容存档于2021-01-22). 
  58. ^ 'Edward2' TensorFlow Probability module. GitHub. [2018-10-02]. (原始内容存档于2020-01-08) (英语). 
  59. ^ Pyro. pyro.ai. [2018-02-09]. (原始内容存档于2021-01-19) (英语). 
  60. ^ NumPyro. pyro.ai. [2021-07-23]. (原始内容存档于2022-10-31) (英语). 
  61. ^ CogComp - Home. [2021-01-16]. (原始内容存档于2018-01-16). 
  62. ^ Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation. [2021-01-16]. (原始内容存档于2021-04-02). 
  63. ^ Rienstra, Tjitze, RankPL: A qualitative probabilistic programming language based on ranking theory, 2018-01-18 [2018-01-18], (原始内容存档于2020-11-09) 
  64. ^ Probabilistic Programming in Birch. birch-lang.org. [2018-04-20]. (原始内容存档于2021-01-29). 
  65. ^ PSI Solver - Exact inference for probabilistic programs. psisolver.org. [2019-08-18]. (原始内容存档于2021-01-23). 
  66. ^ Blang Homepage. [2022-08-31]. (原始内容存档于2021-05-10). 
  67. ^ Perov, Yura; Graham, Logan; Gourgoulias, Kostis; Richens, Jonathan G.; Lee, Ciarán M.; Baker, Adam; Johri, Saurabh, MultiVerse: Causal Reasoning using Importance Sampling in Probabilistic Programming, 2020-01-28, arXiv:1910.08091  
  68. ^ 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. 

外部链接