Content deleted Content added
added a reference using Turing.jl in pharmaceutical |
m Open access bot: url-access updated in citation with #oabot. |
||
(46 intermediate revisions by 32 users not shown) | |||
Line 1:
{{Short description|Software system for statistical models}}
{{Use mdy dates|date=September 2015}}
{{primary sources|date=December 2014}}
'''Probabilistic programming''' ('''PP''') is a [[programming paradigm]]
| url=http://phys.org/news/2015-04-probabilistic-lines-code-thousands.html
| title=Probabilistic programming does in 50 lines of code what used to take thousands
Line 9:
| date=April 13, 2015
| access-date=2015-04-13 }}
</ref>
== Applications ==
Probabilistic reasoning has been used for a wide variety of tasks such as predicting stock prices, recommending movies, diagnosing computers, detecting cyber intrusions and image detection.<ref name="kurzweilai">{{cite news|url = http://www.kurzweilai.net/short-probabilistic-programming-machine-learning-code-replaces-complex-programs-for-computer-vision-tasks|title = Short probabilistic programming machine-learning code replaces complex programs for computer-vision tasks|date = April 13, 2015|work = KurzweilAI|access-date = 27 Nov 2017}}</ref> However, until recently (partially due to limited computing power), probabilistic programming was limited in scope, and most inference algorithms had to be written manually for each task.
Nevertheless, in 2015, a 50-line probabilistic [[computer vision]] program was used to generate 3D models of human faces based on 2D images of those faces. The program used inverse graphics as the basis of its inference method, and was built using the Picture package in [[Julia (programming language)|Julia]].<ref name="kurzweilai"/> This made possible "in 50 lines of code what used to take thousands".<ref>{{cite web |url=https://news.mit.edu/2015/better-probabilistic-programming-0413 |title=Graphics in reverse |first=Larry |last=Hardesty |date=April 13, 2015}}</ref><ref>{{cite web|url=https://www.theregister.co.uk/2015/04/14/mit_shows_off_machinelearning_script_to_make_creepy_heads/|title=MIT shows off machine-learning script to make CREEPY HEADS|website=[[The Register]]}}</ref>
The [[Gen (probabilistic programming)|Gen]] probabilistic programming library (also written in Julia) has been applied to vision and robotics tasks.<ref>{{Cite web|url=https://venturebeat.com/2019/06/27/mits-gen-programming-system-allows-users-to-easily-create-computer-vision-statistical-ai-and-robotics-programs/|title=MIT's Gen programming system flattens the learning curve for AI projects|date=2019-06-27|website=VentureBeat|language=en-US|access-date=2019-06-27}}</ref>
More recently, the probabilistic programming
Probabilistic programming in Julia has also been combined with [[differentiable programming]] by combining the Julia package Zygote.jl with Turing.jl. <ref name="diffprog-zygote">{{
Probabilistic programming languages are also commonly used in [[Bayesian cognitive science]] to develop and evaluate models of cognition. <ref>{{cite web |last1=Goodman |first1=Noah D |last2=Tenenbaum |first2=Joshua B |last3=Buchsbaum |first3=Daphna |last4=Hartshorne |first4=Joshua |last5=Hawkins |first5=Robert |last6=O'Donnell |first6=Timothy J |last7=Tessler |first7=Michael Henry |title=Probabilistic Models of Cognition |url=http://probmods.org/ |website=Probabilistic Models of Cognition - 2nd Edition |access-date=27 May 2023}}</ref>
== Probabilistic programming languages ==
PPLs often extend from a basic language
The language for WinBUGS was implemented to perform Bayesian computation using Gibbs Sampling and related algorithms. Although implemented in a relatively unknown programming language (Component Pascal), this language permits [[Bayesian inference]] for a wide variety of statistical models using a flexible computational approach. The same BUGS language may be used to specify Bayesian models for inference via different computational choices ("samplers") and conventions or defaults, using a standalone program WinBUGS (or related R packages, rbugs and r2winbugs) and JAGS (Just Another Gibbs Sampler, another standalone program with related R packages including rjags, R2jags, and runjags). More recently, other languages to support Bayesian model specification and inference allow different or more efficient choices for the underlying Bayesian computation, and are accessible from the R data analysis and programming environment, e.g.: [[Stan (software)|Stan]], NIMBLE and NUTS. The influence of the BUGS language is evident in these later languages, which even use the same syntax for some aspects of model specification.
Several PPLs are in active development, including some in beta test.
=== Relational ===
Line 33 ⟶ 35:
A PRM is usually developed with a set of algorithms for reducing, inference about and discovery of concerned distributions, which are embedded into the corresponding PRPL.
=== Probabilistic logic programming ===
{{Main|Probabilistic logic programming}}
Probabilistic logic programming is a [[programming paradigm]] that extends [[logic programming]] with probabilities.
Most approaches to probabilistic logic programming are based on the ''distribution semantics,'' which splits a program into a set of probabilistic facts and a logic program. It defines a probability distribution on interpretations of the [[Herbrand structure|Herbrand universe]] of the program.<ref>{{Cite journal |last=De Raedt |first=Luc |last2=Kimmig |first2=Angelika |date=2015-07-01 |title=Probabilistic (logic) programming concepts |url=https://doi.org/10.1007/s10994-015-5494-z |journal=Machine Learning |language=en |volume=100 |issue=1 |pages=5–47 |doi=10.1007/s10994-015-5494-z |issn=1573-0565}}</ref>
=== List of probabilistic programming languages ===
This list summarises the variety of PPLs that are currently available, and clarifies their origins.{{Overly detailed|date=October 2019}}
{| class="wikitable sortable"
Line 44 ⟶ 53:
| bayesloop<ref name="bayesloop"/><ref name="bayesloop2"/> || Python || Python
|-
|
|-
| Venture<ref name="Venture"/> || [[Scheme (programming language)|Scheme]] || C++
|-
| BayesDB<ref name="BAYESDB"/> || [[SQLite]], [[Python (programming language)|Python]] ||
Line 59 ⟶ 62:
|-
| [[Infer.NET]]<ref name="INFET"/> || .NET Framework || .NET Framework
|-
| diff-SAT<ref name="diff-SAT"/> || [[Answer set programming]], [[Boolean satisfiability problem|SAT (DIMACS CNF)]] ||
Line 70 ⟶ 67:
| [[Probabilistic SQL|PSQL]]<ref name="PSQL"/> || [[SQL]] ||
|-
| BUGS<ref name="BUGS"/> || ||Component Pascal
|-
| Dyna<ref name="Dyna"/> || [[Prolog]] ||
|-
| Figaro<ref name="Figaro"/> || Scala ||Scala
|-
| [[
|-
| ProBT<ref name="ProBT"/> || C++, [[Python (programming language)|Python]] ||
|-
| [[Stan (software)|Stan]]<ref name="Stan"/> || BUGS|| C++
|-
| Hakaru<ref name="Hakaru"/> || [[Haskell (programming language)|Haskell]] || Haskell
Line 95 ⟶ 84:
|-
| ProbCog<ref name="ProbCog"/> || || Java, Python
|-
|-Pomegranate || Python || Cython
|-
|-Infergo|| Go || Go
|-
| [[PyMC3|PyMC]]<ref name="PyMC"/> || Python|| Python
|-
| Rainier<ref>{{Citation|title=stripe/rainier|date=2020-08-19|url=https://github.com/stripe/rainier|publisher=Stripe|access-date=2020-08-26}}</ref><ref>{{Cite web|title=Rainier · Bayesian inference for Scala|url=https://samplerainier.com/|access-date=2020-08-26|website=samplerainier.com}}</ref> || Scala
Line 122 ⟶ 105:
|-
| WebPPL<ref name="WebPPL"/>||JavaScript||JavaScript
|-
| Picture<ref name="kurzweilai"/>
Line 135 ⟶ 114:
| Julia
|-
| Gen<ref>{{Cite web|url=https://
| [[Julia (programming language)|Julia]]
| [[Julia (programming language)|Julia]]
|-
|Edward<ref>{{Cite web|url=http://edwardlib.org/|title=Edward – Home|website=edwardlib.org|access-date=2017-01-17}}</ref>
Line 154 ⟶ 126:
|Python
|-
|Edward2<ref>{{Cite web|url=https://github.com/
|TensorFlow Probability
|Python
Line 163 ⟶ 135:
|-
|NumPyro<ref>{{Cite web|url=http://num.pyro.ai/en/stable/|title=NumPyro|website=pyro.ai|language=en|access-date=2021-07-23}}</ref>
|[[Google JAX|JAX]]
|Python
|-
|Birch<ref>{{Cite web|url=http://birch-lang.org/|title=Probabilistic Programming in Birch|website=birch-lang.org|access-date=2018-04-20}}</ref>
Line 184 ⟶ 145:
|
|D
|-
|Blang<ref>{{Cite web|url=https://www.stat.ubc.ca/~bouchard/blang/|title=Home|website=www.stat.ubc.ca}}</ref>
|
|
|-
|MultiVerse<ref>{{Citation |last1=Perov |first1=Yura |title=MultiVerse: Causal Reasoning using Importance Sampling in Probabilistic Programming |date=2020-01-28 |arxiv=1910.08091 |last2=Graham |first2=Logan |last3=Gourgoulias |first3=Kostis |last4=Richens |first4=Jonathan G. |last5=Lee |first5=Ciarán M. |last6=Baker |first6=Adam |last7=Johri |first7=Saurabh}}</ref>
|Python
|Python
|-
|Anglican<ref>{{Cite web |title=The Anglican Probabilistic Programming System |url=https://probprog.github.io/anglican/ |access-date=2024-10-07 |website=probprog.github.io}}</ref>
|[[Clojure]]
|[[Clojure]]
|}
== Difficulty ==
* Reasoning about variables as probability distributions causes difficulties for novice programmers, but these difficulties can be addressed through use of Bayesian network visualizations and graphs of variable distributions embedded within the source code editor.<ref>{{Cite book|last1=Gorinova|first1=Maria I.|last2=Sarkar|first2=Advait|last3=Blackwell|first3=Alan F.|last4=Syme|first4=Don|title=Proceedings of the 2016 CHI Conference on Human Factors in Computing Systems |chapter=A Live, Multiple-Representation Probabilistic Programming Environment for Novices |date=2016-01-01|series=CHI '16|___location=New York, NY, USA|publisher=ACM|pages=2533–2537|doi=10.1145/2858036.2858221|isbn=9781450333627|s2cid=3201542}}</ref>
* As many PPLs rely on the specification of priors on the variables of interest, specifying informed priors is often difficult for novices. In some cases, libraries such as PyMC provide automated methods to find the parameterization of informed priors.<ref>{{Cite web |title=pymc.find_constrained_prior — PyMC dev documentation |url=https://www.pymc.io/projects/docs/en/latest/api/generated/pymc.find_constrained_prior.html |access-date=2024-10-23 |website=www.pymc.io}}</ref>
==See also==
Line 193 ⟶ 168:
* [[Inductive programming]]
* [[Bayesian programming]]
* [[Plate notation]]
==Notes==
{{Reflist|30em|refs=
<ref name="
<ref name="
<ref name="
<ref name="Analytica">{{cite web|url=http://www.analytica.com|title=Analytica-- A Probabilistic Modeling Language|work=lumina.com}}</ref>
<ref name="Venture">{{cite web|url=http://probcomp.csail.mit.edu/venture/|title=Venture -- a general-purpose probabilistic programming platform|work=mit.edu|access-date=September 20, 2014|archive-url=https://web.archive.org/web/20160125130827/http://probcomp.csail.mit.edu/venture/|archive-date=January 25, 2016|url-status=dead}}</ref>
<ref name="PRISM">{{cite web|url=http://rjida.meijo-u.ac.jp/prism/|title=PRISM: PRogramming In Statistical Modeling|website=rjida.meijo-u.ac.jp|access-date=July 8, 2015|archive-url=https://web.archive.org/web/20150301155729/http://rjida.meijo-u.ac.jp/prism/|archive-date=March 1, 2015|url-status=dead}}</ref>
<ref name="INFET">{{cite web|url=http://research.microsoft.com/en-us/um/cambridge/projects/infernet/|title=Infer.NET|publisher=Microsoft|work=microsoft.com}}</ref>
<ref name="
<ref name="PSQL">{{cite journal|title=PSQL: A query language for probabilistic relational data|doi=10.1016/S0169-023X(98)00015-9 | volume=28|journal=Data & Knowledge Engineering|pages=107–120|year = 1998|last1 = Dey|first1 = Debabrata|last2=Sarkar |first2=Sumit }}</ref>
<ref name="BUGS">{{cite web|url=http://www.mrc-bsu.cam.ac.uk/bugs/|title=The BUGS Project - MRC Biostatistics Unit|work=cam.ac.uk|access-date=January 12, 2011|archive-url=https://web.archive.org/web/20140314080841/http://www.mrc-bsu.cam.ac.uk/bugs/|archive-date=March 14, 2014|url-status=dead}}</ref>
<ref name="Dyna">{{cite web|url=http://www.dyna.org/|title=Dyna|website=www.dyna.org|access-date=January 12, 2011|archive-url=https://web.archive.org/web/20160117155947/http://dyna.org/|archive-date=January 17, 2016|url-status=dead}}</ref>
<ref name="Figaro">{{cite web|url=http://www.cra.com/figaro|title=Charles River Analytics - Probabilistic Modeling Services|work=cra.com|date=February 9, 2017}}</ref>
<ref name="ProbLog">{{cite web|url=http://dtai.cs.kuleuven.be/problog|title=ProbLog: Probabilistic Programming|website=dtai.cs.kuleuven.be}}</ref>
<ref name="ProBT">{{cite web|url=http://www.probayes.com/fr/Bayesian-Programming-Book/downloads/|title=ProbaYes - Ensemble, nous valorisations vos données|author=ProbaYes|work=probayes.com|access-date=November 26, 2013|archive-url=https://web.archive.org/web/20160305000751/http://www.probayes.com/fr/Bayesian-Programming-Book/downloads/|archive-date=March 5, 2016|url-status=dead}}</ref>
Line 227 ⟶ 190:
<ref name="BAli-Phy">{{cite web|url=http://www.bali-phy.org/|title=BAli-Phy Home Page|work=bali-phy.org}}</ref>
<ref name="ProbCog">{{cite web|url=https://github.com/opcode81/ProbCog/wiki/Features|title=ProbCog|work=GitHub}}</ref>
<ref name="
<ref name="Lea">{{cite web|url=https://bitbucket.org/piedenis/lea|title=Lea Home Page|work=bitbucket.org}}</ref>
<ref name="WebPPL">{{cite web|url=http://dippl.org/|title=WebPPL Home Page|work=github.com/probmods/webppl}}</ref>
<ref name="Turingjl">{{cite web|url=https://github.com/yebai/Turing.jl|title=The Turing language for probabilistic programming|website=[[GitHub]]|date=December 28, 2021}}</ref>
<ref name="
}}
== External links ==
*[https://www.cambridge.org/core/books/foundations-of-probabilistic-programming/819623B1B5B33836476618AC0621F0EE Foundations of Probabilistic Programming]
*[http://anyall.org/blog/2009/12/list-of-probabilistic-model-mini-language-toolkits/ List of Probabilistic Model Mini Language Toolkits]
{{Programming paradigms navbox}}
[[Category:Probabilistic models]]
|