SlideShare uma empresa Scribd logo
1 de 24
Probabilistic Programming: a Broad Overview
Eli Sennesh
Bayesian Statistics in One Graph
Bayesian Role-Playing Games
● With enough paper, we could just write out every possible play
based on every possible dice-roll and the fixed player levels.
● How many ways could we have gotten from the start of the
game to the board we see? That's a likelihood.
● Which dice rolls were more common in games that gave us the
real play? That's a posterior probability.
● Bayesianism: unknown levels are just more dice.
– And are the actual dice weighted?
Bayesian Reasoning is Hard!
● P(H | E) = P(E | H)*P(H) / ∫ P(E | H)*P(H) dH
● Bayesian reasoning: how to update beliefs in response to
evidence
● But the integral in the denominator often cannot be solved
analytically.
● Approaches: conjugate priors and posteriors (for which we don't
need to evaluate it), various numerical methods
The Trouble with Bayesian Modeling (1)
Calculating probabilities takes time exponential in the number of relevant variables!
The Trouble with Bayesian Modeling (2)
The Trouble with Bayesian Modeling (3)
● Exact Bayesian inference methods only support possible-worlds
with a finite number of things in them.
● Every combination of model and inference method currently has
to be combined manually into non-reusable code.
● Probabilistic modeling as we think we know it is inexpressive
and slow, ranging in complexity from NP-complete to
DEXPTIME.
Programs have generative structure
● Generative model = Rules + Randomness + Random
Parameters
– A program for generating random outcomes, given unknown
parameters.
● Probabilistic Program = Probability Distribution
● The Stochastic Lambda Calculus: a Turing-complete language
with random choices.
– In jargon: the 'probability monad'.
What sorts of queries?
● Sampling: 'What are some possibilities?'
● Expectation: 'What should we expect to see?'
● Support: 'What could happen?'
● Probability mass/density: 'What's the chance this happens?'
● Conditional query: 'Given this, what about that? What about
when X happens more than Y?'
– 'Given that I saw 18 black ravens, what proportion of all ravens are
black?'
What sorts of inference?
● Mostly sampling-based approximate inference, but there are
some exact algorithms.
● By sampling, we can reason about models where each possible
world might contain a different number of actual entities.
● Approximate inference only has a small cost of its own after we
generate many samples from the distribution.
– And advanced inference algorithms can re-use parts of computations
to sample even faster.
What can probabilistic programs express?
● In a 'code as data' language like Church (based on Scheme),
programs can include eval and learn arbitrary code.
● Or they can do a query about a query: inference about
inference.
● Generative structure generalizes logical and physical structure:
'The λ-calculus does not focus on the sequence of time, but rather o
The Elegance of Probabilistic Programming
● Programs = Distributions.
– Running a program = sampling an outcome from the distribution
– Monadic semantics: every function maps input values to output
distributions.
● Queries are just functions; language runtime performs
inference.
● '[H]allucinate possible worlds', and reason about them.
Probabilistic Programs Can Explain Themselves
Slide taken from Olivi
How can we use probabilistic programming?
● 'We would like to build computing machines that can interpret
and learn from their sensory experience, act effectively in real
time, and - ultimately - design and program themselves.'
● Professor Vikash Mansinghka, 'Natively Probabilistic Computation'
● Applications in: computer vision, cognitive science, machine
learning, natural language processing, and artificial intelligence.
How can I use probabilistic programming?
● Write a program simulating whatever you want to reason about.
Where you don't know which specific choice to make, choose
randomly.
● Present the language runtime's inference engine with real-world
data compatible with your model.
– And go get some coffee.
● The inference engine will learn which random choices generate
data like yours.
Computer Vision in 20 Lines of Code (1)
Computer Vision in 20 Lines of Code (2)
● The prior model 'knows' how to render pictures, but chooses
what to render completely at random. Inference then 'learns'
which choices most likely drew the real image.
● 'Our probabilistic graphics program did not originally support
rotation, which was needed for the AOL CAPTCHAs; adding it
required only 1 additional line of probabilistic code.'
– http://probcomp.csail.mit.edu/gpgp/
● Homework takes more than 20 lines of code!
Which bar should we meet at?
Social reasoning and cooperation in 11 LOC.
Modeling where to meet for drinks
(define (sample-location) (if (flip .55) 'popular-bar 'unpopular-bar))
(define (alice depth)
(query
(define alice-location (sample-location))
alice-location
(equal? alice-location (bob (- depth 1)))))
(define (bob depth)
(query
(define bob-location (sample-location))
bob-location
(or (= depth 0) (equal? bob-location (alice depth)))))
The correct answer is actually Libirah!
Generating Scenes Under Constraints
● Sample fresh coffee shops, conditioned on the constraints of good design.
● Scene generation is an open-world task: not just where to put furniture but how
much to generate is random.
● Exact inference can't even handle these models!
What more needs doing?
● Sampling-based approximation helps, but we need better inference
algorithms. No real-time reasoning yet.
● Techniques from compilers research help.
– One recent paper got a 600x speed-up by caching the nonrandom parts of
each computation and applying Just-In-Time compilation.
● Halting Problem, Rice's Theorem: we can't prove one inference
algorithm supreme in all circumstances.
● Reusable data: export what we've learned and pass it on to others.
● Ways to treat intractability probabilistically
Conclusions
● Rules = Programs, Uncertain knowledge = Random choice.
● Rules + Uncertainty = Programs + Randomness = Probabilistic
Programming
● Probabilistic programs can express any complex model, but need to
improve our inference algorithms to make reasoning tractable.
● Fields of application: cognitive science, procedural content
generation, machine learning, computer vision, Bayesian statistics,
artificial intelligence.
Bibliography (1)
● Probabilistic Models of Cognition
● http://probabilistic-programming.org/research/, http://forestdb.org/
● Vikash Mansinghka. Natively Probabilistic Computation. PhD thesis, Massachusetts
Institute of Technology, 2009.
● Noah D. Goodman, Vikash K. Mansinghka, Daniel M. Roy, Keith Bonawitz, and
Joshua B. Tenenbaum. Church: a language for generative models. In Proc. of
Uncertainty in Artificial Intelligence, 2008.
● Fritz Obermeyer. Automated equational reasoning in nondeterministic lambda-calculi
modulo theories H*. PhD thesis, Carnegie-Mellon University, 2009.
Bibliography (2)
● Vikash Mansinghka, Tejas Kulkarni, Yura Perov, Josh Tenenbaum. Approximate Bayesian
Image Interpretation using Generative Probabilistic Graphics Programs. Neural Information
Processing Systems 2013.
●
Andrew D. Gordon, Thomas A. Henzinger, Aditya V. Nori, and Sriram K. Rajamani. Probabilistic
programming. In International Conference on Software Engineering (ICSE, FOSE track), 2014.
● Andreas Stuhlmüller and Noah D. Goodman. Reasoning about Reasoning by Nested
Conditioning: Modeling Theory of Mind with Probabilistic Programs. In Cognitive Systems
Research, 2013.
● Yi-Ting Yeh, Lingfeng Yang, Matthew Watson, Noah D. Goodman, and Pat Hanrahan. 2012.
Synthesizing open worlds with constraints using locally annealed reversible jump MCMC. ACM
Trans. Graph. 31, 4, Article 56 (July 2012).

Mais conteúdo relacionado

Mais procurados

Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdf
Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdfRetrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdf
Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdf
Po-Chuan Chen
 

Mais procurados (20)

2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Hash Function
Hash FunctionHash Function
Hash Function
 
Homomorphic encryption
Homomorphic encryptionHomomorphic encryption
Homomorphic encryption
 
Neural Networks and Deep Learning: An Intro
Neural Networks and Deep Learning: An IntroNeural Networks and Deep Learning: An Intro
Neural Networks and Deep Learning: An Intro
 
Artificial intelligence and first order logic
Artificial intelligence and first order logicArtificial intelligence and first order logic
Artificial intelligence and first order logic
 
Natural language processing: feature extraction
Natural language processing: feature extractionNatural language processing: feature extraction
Natural language processing: feature extraction
 
Introduction to natural language processing
Introduction to natural language processingIntroduction to natural language processing
Introduction to natural language processing
 
NLP State of the Art | BERT
NLP State of the Art | BERTNLP State of the Art | BERT
NLP State of the Art | BERT
 
Hash function
Hash function Hash function
Hash function
 
Word2Vec
Word2VecWord2Vec
Word2Vec
 
ECC vs RSA: Battle of the Crypto-Ninjas
ECC vs RSA: Battle of the Crypto-NinjasECC vs RSA: Battle of the Crypto-Ninjas
ECC vs RSA: Battle of the Crypto-Ninjas
 
Overview of project planning
Overview of project planningOverview of project planning
Overview of project planning
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Natural language processing and transformer models
Natural language processing and transformer modelsNatural language processing and transformer models
Natural language processing and transformer models
 
Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdf
Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdfRetrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdf
Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.pdf
 
SHA 1 Algorithm
SHA 1 AlgorithmSHA 1 Algorithm
SHA 1 Algorithm
 
Network security cryptographic hash function
Network security  cryptographic hash functionNetwork security  cryptographic hash function
Network security cryptographic hash function
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
 
Trusted systems
Trusted systemsTrusted systems
Trusted systems
 
[PR12] PR-050: Convolutional LSTM Network: A Machine Learning Approach for Pr...
[PR12] PR-050: Convolutional LSTM Network: A Machine Learning Approach for Pr...[PR12] PR-050: Convolutional LSTM Network: A Machine Learning Approach for Pr...
[PR12] PR-050: Convolutional LSTM Network: A Machine Learning Approach for Pr...
 

Destaque

Destaque (20)

Probabilistic Programming in Python
Probabilistic Programming in PythonProbabilistic Programming in Python
Probabilistic Programming in Python
 
Digital Data Tips Tuesday #1 - Tag Management: Simo Ahava - NetBooster
Digital Data Tips Tuesday #1 - Tag Management: Simo Ahava - NetBoosterDigital Data Tips Tuesday #1 - Tag Management: Simo Ahava - NetBooster
Digital Data Tips Tuesday #1 - Tag Management: Simo Ahava - NetBooster
 
Datomic
DatomicDatomic
Datomic
 
Datomic
DatomicDatomic
Datomic
 
Datomic
DatomicDatomic
Datomic
 
Workshop
WorkshopWorkshop
Workshop
 
Jim rohn
Jim  rohnJim  rohn
Jim rohn
 
Tesco
TescoTesco
Tesco
 
Waldorf Education
Waldorf EducationWaldorf Education
Waldorf Education
 
Tesco
TescoTesco
Tesco
 
Selena Gomez
Selena GomezSelena Gomez
Selena Gomez
 
French Property Market 2014
French Property Market 2014French Property Market 2014
French Property Market 2014
 
Management Consulting
Management ConsultingManagement Consulting
Management Consulting
 
Oprah Winfrey
Oprah WinfreyOprah Winfrey
Oprah Winfrey
 
ReactJs
ReactJsReactJs
ReactJs
 
Medical devices
Medical devicesMedical devices
Medical devices
 
French Property market 2015 - Cushman & Wakefield
French Property market 2015 - Cushman & WakefieldFrench Property market 2015 - Cushman & Wakefield
French Property market 2015 - Cushman & Wakefield
 
Cerebral Palsy
Cerebral PalsyCerebral Palsy
Cerebral Palsy
 
ReactJS | 서버와 클라이어트에서 동시에 사용하는
ReactJS | 서버와 클라이어트에서 동시에 사용하는ReactJS | 서버와 클라이어트에서 동시에 사용하는
ReactJS | 서버와 클라이어트에서 동시에 사용하는
 
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
Simo Ahava - Tag Management Solutions – Best. Data. Ever. MKTFEST 2014
 

Semelhante a Probabilistic programming

Building graphs to discover information by David Martínez at Big Data Spain 2015
Building graphs to discover information by David Martínez at Big Data Spain 2015Building graphs to discover information by David Martínez at Big Data Spain 2015
Building graphs to discover information by David Martínez at Big Data Spain 2015
Big Data Spain
 
Machine Learning ICS 273A
Machine Learning ICS 273AMachine Learning ICS 273A
Machine Learning ICS 273A
butest
 

Semelhante a Probabilistic programming (20)

Building graphs to discover information by David Martínez at Big Data Spain 2015
Building graphs to discover information by David Martínez at Big Data Spain 2015Building graphs to discover information by David Martínez at Big Data Spain 2015
Building graphs to discover information by David Martínez at Big Data Spain 2015
 
On being a professional software developer
On being a professional software developerOn being a professional software developer
On being a professional software developer
 
Антон Кириллов, ZeptoLab
Антон Кириллов, ZeptoLabАнтон Кириллов, ZeptoLab
Антон Кириллов, ZeptoLab
 
AI Presentation 1
AI Presentation 1AI Presentation 1
AI Presentation 1
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
 
Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...
Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...
Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...
 
Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...
Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...
Professor Steve Roberts; The Bayesian Crowd: scalable information combinati...
 
Interactive Narrative Intelligence: Modeling, Design, and Support
Interactive Narrative Intelligence: Modeling, Design, and SupportInteractive Narrative Intelligence: Modeling, Design, and Support
Interactive Narrative Intelligence: Modeling, Design, and Support
 
Introduction to Soft Computing (intro to the building blocks of SC)
Introduction to Soft Computing (intro to the building blocks of SC)Introduction to Soft Computing (intro to the building blocks of SC)
Introduction to Soft Computing (intro to the building blocks of SC)
 
Machine Learning ICS 273A
Machine Learning ICS 273AMachine Learning ICS 273A
Machine Learning ICS 273A
 
Computational Thinking - 101
Computational Thinking - 101Computational Thinking - 101
Computational Thinking - 101
 
The year was 1967
The year was 1967The year was 1967
The year was 1967
 
Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018
Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018
Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018
 
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
 
Frontiers of Computational Journalism week 1 - Introduction and High Dimensio...
Frontiers of Computational Journalism week 1 - Introduction and High Dimensio...Frontiers of Computational Journalism week 1 - Introduction and High Dimensio...
Frontiers of Computational Journalism week 1 - Introduction and High Dimensio...
 
AGI: Still relevant?
AGI: Still relevant?AGI: Still relevant?
AGI: Still relevant?
 
Hacking Predictive Modeling - RoadSec 2018
Hacking Predictive Modeling - RoadSec 2018Hacking Predictive Modeling - RoadSec 2018
Hacking Predictive Modeling - RoadSec 2018
 
GDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentGDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game Development
 
Housing price prediction
Housing price predictionHousing price prediction
Housing price prediction
 
Basics of Soft Computing
Basics of Soft  Computing Basics of Soft  Computing
Basics of Soft Computing
 

Último

The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptx
seri bangash
 
biology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGYbiology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGY
1301aanya
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
NazaninKarimi6
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptx
MohamedFarag457087
 
POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.
Silpa
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
levieagacer
 
LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.
Silpa
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Sérgio Sacani
 

Último (20)

The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptx
 
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
 
biology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGYbiology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGY
 
Atp synthase , Atp synthase complex 1 to 4.
Atp synthase , Atp synthase complex 1 to 4.Atp synthase , Atp synthase complex 1 to 4.
Atp synthase , Atp synthase complex 1 to 4.
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
Use of mutants in understanding seedling development.pptx
Use of mutants in understanding seedling development.pptxUse of mutants in understanding seedling development.pptx
Use of mutants in understanding seedling development.pptx
 
Chemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdfChemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdf
 
Genetics and epigenetics of ADHD and comorbid conditions
Genetics and epigenetics of ADHD and comorbid conditionsGenetics and epigenetics of ADHD and comorbid conditions
Genetics and epigenetics of ADHD and comorbid conditions
 
Role of AI in seed science Predictive modelling and Beyond.pptx
Role of AI in seed science  Predictive modelling and  Beyond.pptxRole of AI in seed science  Predictive modelling and  Beyond.pptx
Role of AI in seed science Predictive modelling and Beyond.pptx
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptx
 
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
 
POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.
 
Dr. E. Muralinath_ Blood indices_clinical aspects
Dr. E. Muralinath_ Blood indices_clinical  aspectsDr. E. Muralinath_ Blood indices_clinical  aspects
Dr. E. Muralinath_ Blood indices_clinical aspects
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.LUNULARIA -features, morphology, anatomy ,reproduction etc.
LUNULARIA -features, morphology, anatomy ,reproduction etc.
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
300003-World Science Day For Peace And Development.pptx
300003-World Science Day For Peace And Development.pptx300003-World Science Day For Peace And Development.pptx
300003-World Science Day For Peace And Development.pptx
 
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRingsTransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
 

Probabilistic programming

  • 1. Probabilistic Programming: a Broad Overview Eli Sennesh
  • 3. Bayesian Role-Playing Games ● With enough paper, we could just write out every possible play based on every possible dice-roll and the fixed player levels. ● How many ways could we have gotten from the start of the game to the board we see? That's a likelihood. ● Which dice rolls were more common in games that gave us the real play? That's a posterior probability. ● Bayesianism: unknown levels are just more dice. – And are the actual dice weighted?
  • 4. Bayesian Reasoning is Hard! ● P(H | E) = P(E | H)*P(H) / ∫ P(E | H)*P(H) dH ● Bayesian reasoning: how to update beliefs in response to evidence ● But the integral in the denominator often cannot be solved analytically. ● Approaches: conjugate priors and posteriors (for which we don't need to evaluate it), various numerical methods
  • 5. The Trouble with Bayesian Modeling (1) Calculating probabilities takes time exponential in the number of relevant variables!
  • 6. The Trouble with Bayesian Modeling (2)
  • 7. The Trouble with Bayesian Modeling (3) ● Exact Bayesian inference methods only support possible-worlds with a finite number of things in them. ● Every combination of model and inference method currently has to be combined manually into non-reusable code. ● Probabilistic modeling as we think we know it is inexpressive and slow, ranging in complexity from NP-complete to DEXPTIME.
  • 8. Programs have generative structure ● Generative model = Rules + Randomness + Random Parameters – A program for generating random outcomes, given unknown parameters. ● Probabilistic Program = Probability Distribution ● The Stochastic Lambda Calculus: a Turing-complete language with random choices. – In jargon: the 'probability monad'.
  • 9. What sorts of queries? ● Sampling: 'What are some possibilities?' ● Expectation: 'What should we expect to see?' ● Support: 'What could happen?' ● Probability mass/density: 'What's the chance this happens?' ● Conditional query: 'Given this, what about that? What about when X happens more than Y?' – 'Given that I saw 18 black ravens, what proportion of all ravens are black?'
  • 10. What sorts of inference? ● Mostly sampling-based approximate inference, but there are some exact algorithms. ● By sampling, we can reason about models where each possible world might contain a different number of actual entities. ● Approximate inference only has a small cost of its own after we generate many samples from the distribution. – And advanced inference algorithms can re-use parts of computations to sample even faster.
  • 11. What can probabilistic programs express? ● In a 'code as data' language like Church (based on Scheme), programs can include eval and learn arbitrary code. ● Or they can do a query about a query: inference about inference. ● Generative structure generalizes logical and physical structure: 'The λ-calculus does not focus on the sequence of time, but rather o
  • 12. The Elegance of Probabilistic Programming ● Programs = Distributions. – Running a program = sampling an outcome from the distribution – Monadic semantics: every function maps input values to output distributions. ● Queries are just functions; language runtime performs inference. ● '[H]allucinate possible worlds', and reason about them.
  • 13. Probabilistic Programs Can Explain Themselves Slide taken from Olivi
  • 14. How can we use probabilistic programming? ● 'We would like to build computing machines that can interpret and learn from their sensory experience, act effectively in real time, and - ultimately - design and program themselves.' ● Professor Vikash Mansinghka, 'Natively Probabilistic Computation' ● Applications in: computer vision, cognitive science, machine learning, natural language processing, and artificial intelligence.
  • 15. How can I use probabilistic programming? ● Write a program simulating whatever you want to reason about. Where you don't know which specific choice to make, choose randomly. ● Present the language runtime's inference engine with real-world data compatible with your model. – And go get some coffee. ● The inference engine will learn which random choices generate data like yours.
  • 16. Computer Vision in 20 Lines of Code (1)
  • 17. Computer Vision in 20 Lines of Code (2) ● The prior model 'knows' how to render pictures, but chooses what to render completely at random. Inference then 'learns' which choices most likely drew the real image. ● 'Our probabilistic graphics program did not originally support rotation, which was needed for the AOL CAPTCHAs; adding it required only 1 additional line of probabilistic code.' – http://probcomp.csail.mit.edu/gpgp/ ● Homework takes more than 20 lines of code!
  • 18. Which bar should we meet at? Social reasoning and cooperation in 11 LOC.
  • 19. Modeling where to meet for drinks (define (sample-location) (if (flip .55) 'popular-bar 'unpopular-bar)) (define (alice depth) (query (define alice-location (sample-location)) alice-location (equal? alice-location (bob (- depth 1))))) (define (bob depth) (query (define bob-location (sample-location)) bob-location (or (= depth 0) (equal? bob-location (alice depth))))) The correct answer is actually Libirah!
  • 20. Generating Scenes Under Constraints ● Sample fresh coffee shops, conditioned on the constraints of good design. ● Scene generation is an open-world task: not just where to put furniture but how much to generate is random. ● Exact inference can't even handle these models!
  • 21. What more needs doing? ● Sampling-based approximation helps, but we need better inference algorithms. No real-time reasoning yet. ● Techniques from compilers research help. – One recent paper got a 600x speed-up by caching the nonrandom parts of each computation and applying Just-In-Time compilation. ● Halting Problem, Rice's Theorem: we can't prove one inference algorithm supreme in all circumstances. ● Reusable data: export what we've learned and pass it on to others. ● Ways to treat intractability probabilistically
  • 22. Conclusions ● Rules = Programs, Uncertain knowledge = Random choice. ● Rules + Uncertainty = Programs + Randomness = Probabilistic Programming ● Probabilistic programs can express any complex model, but need to improve our inference algorithms to make reasoning tractable. ● Fields of application: cognitive science, procedural content generation, machine learning, computer vision, Bayesian statistics, artificial intelligence.
  • 23. Bibliography (1) ● Probabilistic Models of Cognition ● http://probabilistic-programming.org/research/, http://forestdb.org/ ● Vikash Mansinghka. Natively Probabilistic Computation. PhD thesis, Massachusetts Institute of Technology, 2009. ● Noah D. Goodman, Vikash K. Mansinghka, Daniel M. Roy, Keith Bonawitz, and Joshua B. Tenenbaum. Church: a language for generative models. In Proc. of Uncertainty in Artificial Intelligence, 2008. ● Fritz Obermeyer. Automated equational reasoning in nondeterministic lambda-calculi modulo theories H*. PhD thesis, Carnegie-Mellon University, 2009.
  • 24. Bibliography (2) ● Vikash Mansinghka, Tejas Kulkarni, Yura Perov, Josh Tenenbaum. Approximate Bayesian Image Interpretation using Generative Probabilistic Graphics Programs. Neural Information Processing Systems 2013. ● Andrew D. Gordon, Thomas A. Henzinger, Aditya V. Nori, and Sriram K. Rajamani. Probabilistic programming. In International Conference on Software Engineering (ICSE, FOSE track), 2014. ● Andreas Stuhlmüller and Noah D. Goodman. Reasoning about Reasoning by Nested Conditioning: Modeling Theory of Mind with Probabilistic Programs. In Cognitive Systems Research, 2013. ● Yi-Ting Yeh, Lingfeng Yang, Matthew Watson, Noah D. Goodman, and Pat Hanrahan. 2012. Synthesizing open worlds with constraints using locally annealed reversible jump MCMC. ACM Trans. Graph. 31, 4, Article 56 (July 2012).