Probabilistic programming#Applications
{{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 based on the declarative specification of probabilistic models, for which inference is performed automatically.{{cite news
| 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
| work=phys.org
| date=April 13, 2015
| access-date=2015-04-13 }}
Probabilistic programming attempts to unify probabilistic modeling and traditional general purpose programming in order to make the former easier and more widely applicable.{{cite web|url=http://probabilistic-programming.org/wiki/Home|title=Probabilistic Programming|work=probabilistic-programming.org|access-date=December 24, 2013|archive-url=https://web.archive.org/web/20160110035042/http://probabilistic-programming.org/wiki/Home|archive-date=January 10, 2016|url-status=dead}}Pfeffer, Avrom (2014), Practical Probabilistic Programming, Manning Publications. p.28. {{ISBN|978-1 6172-9233-0}} It can be used to create systems that help make decisions in the face of uncertainty. Programming languages following the probabilistic programming paradigm are referred to as "probabilistic programming languages" (PPLs).
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.{{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}} 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. This made possible "in 50 lines of code what used to take thousands".{{cite web |url=https://news.mit.edu/2015/better-probabilistic-programming-0413 |title=Graphics in reverse |first=Larry |last=Hardesty |date=April 13, 2015}}{{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}}
The Gen probabilistic programming library (also written in Julia) has been applied to vision and robotics tasks.{{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}}
More recently, the probabilistic programming system Turing.jl has been applied in various pharmaceutical{{Cite journal|last1=Semenova|first1=Elizaveta|last2=Williams|first2=Dominic P.|last3=Afzal|first3=Avid M.|last4=Lazic|first4=Stanley E.|date=2020-11-01|title=A Bayesian neural network for toxicity prediction|url=https://www.sciencedirect.com/science/article/pii/S2468111320300438|journal=Computational Toxicology|language=en|volume=16|pages=100133|doi=10.1016/j.comtox.2020.100133|s2cid=225362130|issn=2468-1113}} and economics applications.{{Citation|title= Predicting Drug-Induced Liver Injury with Bayesian Machine Learning |year= 2020 |doi= 10.1021/acs.chemrestox.9b00264 |url= https://pubs.acs.org/doi/10.1021/acs.chemrestox.9b00264|last1= Williams |first1= Dominic P. |last2= Lazic |first2= Stanley E. |last3= Foster |first3= Alison J. |last4= Semenova |first4= Elizaveta |last5= Morgan |first5= Paul |journal= Chemical Research in Toxicology |volume= 33 |issue= 1 |pages= 239–248 |pmid= 31535850 |s2cid= 202689667 |url-access= subscription }}
Probabilistic programming in Julia has also been combined with differentiable programming by combining the Julia package Zygote.jl with Turing.jl. {{cite arXiv|date=2019|title=∂P: A Differentiable Programming System to Bridge Machine Learning and Scientific Computing|eprint=1907.07587|last1=Innes|first1=Mike|last2=Edelman|first2=Alan|last3=Fischer|first3=Keno|last4=Rackauckas|first4=Chris|last5=Saba|first5=Elliot|author6=Viral B Shah|last7=Tebbutt|first7=Will|class=cs.PL }}
Probabilistic programming languages are also commonly used in Bayesian cognitive science to develop and evaluate models of cognition. {{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}}
Probabilistic programming languages
PPLs often extend from a basic language. For instance, Turing.jl is based on Julia, Infer.NET is based on .NET Framework, while PRISM extends from Prolog. However, some PPLs, such as WinBUGS, offer a self-contained language that maps closely to the mathematical representation of the statistical models, with no obvious origin in another programming 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, 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. Two popular tools are Stan and PyMC.{{Cite web|url=http://blog.fastforwardlabs.com/2017/01/30/the-algorithms-behind-probabilistic-programming.html|title=The Algorithms Behind Probabilistic Programming|access-date=2017-03-10}}
= Relational =
A probabilistic relational programming language (PRPL) is a PPL specially designed to describe and infer with probabilistic relational models (PRMs).
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 universe of the program.{{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}}
= 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}}
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.{{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}}
- 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.{{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}}
See also
Notes
{{Reflist|30em|refs=
{{cite web|url=https://github.com/christophmark/bayesloop|title=GitHub -- bayesloop|website=GitHub|date=December 7, 2021}}
{{cite web|url=https://github.com/MatthiasNickles/diff-SAT/|title=diff-SAT (probabilistic SAT/ASP)|website=GitHub|date=October 8, 2021}}
{{cite web|url=https://hakaru-dev.github.io/|title=Hakaru Home Page|work=hakaru-dev.github.io/}}
{{cite web|url=http://www.bali-phy.org/|title=BAli-Phy Home Page|work=bali-phy.org}}
{{cite web|url=https://github.com/opcode81/ProbCog/wiki/Features|title=ProbCog|work=GitHub}}
{{cite web|url=https://docs.pymc.io/en/v3/|title=PyMC|author=PyMC devs|work=pymc-devs.github.io}}
{{cite web|url=https://bitbucket.org/piedenis/lea|title=Lea Home Page|work=bitbucket.org}}
{{cite web|url=http://dippl.org/|title=WebPPL Home Page|work=github.com/probmods/webppl}}
{{cite web|url=https://github.com/yebai/Turing.jl|title=The Turing language for probabilistic programming|website=GitHub|date=December 28, 2021}}
}}
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}}