Bayesian Cognition Cours 2: Bayesian programming

Julien Diard CNRS - Laboratoire de Psychologie et NeuroCognition Grenoble Pierre Bessière CNRS - Institut des Systèmes Intelligents et de Robotique Paris

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 2

Contents / schedule

• Cours 1 30/09/15, C-ADM008-Amphi J. Besson – Incompleteness to uncertainty: Bayesian programming and inference • Cours 2 14/10/15, C-ADM008-Amphi J. Besson – Bayesian programming • Cours 3 21/10/15, C-ADM008-Amphi J. Besson – Bayesian robot programming (part 1) • Cours 4 04/11/15, C-ADM008-Amphi J. Besson – Bayesian robot programming (part 2) – Bayesian cognitive modeling (part 1) • Cours 5 18/11/15, C-ADM008-Amphi J. Besson – Bayesian cognitive modeling (part 2) • Cours 6 20/12/15, C-ADM008-Amphi J. Besson – Bayesian model comparison, bayesian model distinguishability • Examen ?/?/? (pour les M2)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 3

Plan

• Summary & questions! • Bayesian Programming methodology – Variables – Decomposition & hypotheses – Parametric forms (demo) – Learning – Inference • Taxonomy of Bayesian models

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 4

Probability Theory As Extended Logic • Probabilités • Probabilités « fréquentistes » « subjectives » E.T. Jaynes (1922-1998) – Une probabilité est une – Référence à un état de propriété physique d'un connaissance d'un sujet • P(« il pleut » | Jean), objet P(« il pleut » | Pierre) – Axiomatique de • Pas de référence à la limite Kolmogorov, théorie d’occurrence d’un des ensembles événement (fréquence) • Probabilités conditionnelles N – P (A)=fA = limN – P(A | π) et jamais P(A) ⇥ N – Statistiques classiques – Statistiques bayésiennes • Population parente, etc.

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 5

Principle Incompleteness Preliminary Knowledge + Bayesian Learning Experimental Data = Probabilistic Representation Uncertainty

P(a) P( a) 1 + ¬ = P(a∧b) = P(a)P(b | a) = P(b)P(a | b)

Decision€

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 6

Règles de calcul • Règle du produit P (AB C)=P (A C)P (B AC) | | | = P (B C)P (A BC) | | Reverend Thomas Bayes è Théorème de Bayes (~1702-1761) P (B C)P (A BC) P (B AC)= | | , si P (A C) =0 | P (A C) | • Règle de la somme |

P (A C)+P (A¯ C)=1 P ([A = a] C)=1 | | | a A è Règle de marginalisation P (AB C)=P (B C) | | A Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 7

Bayesian Program methodology

Specification • Variables

• Decomposition

• Parametrical Forms or Recursive Question

Description Preliminary Knowledge π

Identification

Program Program Experimental Data δ

Inference Question

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 8

Bayesian Program = Spam detection example

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 9

Plan

• Summary & questions! • Bayesian Programming methodology – Variables – Decomposition & conditional independence hypotheses – Parametric forms (demo) – Learning – Inference • Taxonomy of Bayesian models

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 10

Bayesian Program

Specification • Variables

• Decomposition

• Parametrical Forms or Recursive Question

Description Preliminary Knowledge π

Identification

Program Program Experimental Data δ

Inference Question

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 11

Logical Proposition

Logical Propositions are denoted by lowercase names: a

Usual logical operators: a∧b a∨b € ¬a

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 12

Probability of Logical Proposition To assign a probability to a given proposition a, it is necessary to have at least some preliminary knowledge, summed up by a proposition π. P(a | π) ∈ [0,1]

Probabilities of the conjunctions, disjunctions and negations of propositions: € P(a ∧ b | π) P(a ∨ b | π) P(¬a | π) Probability of proposition a conditioned by both the preliminary knowledge π and some other proposition b: P(a | b ∧ π)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 13

Normalization and Product rule

P(a | π) + P(¬a | π) =1

€ P(a∧b | π) = P(a | π) × P(b | a∧π) = P(b | π) × P(a | b∧π)

€ P(a∨b | π) = P(a | π) + P(b | π) − P(a∧b | π)

€ Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 14

Discrete Variable

• Variables are denoted by names starting with one uppercase letter: X • Definition: a discrete variable X is a set of propositions xi – Mutually exclusive: i ≠ j ⇒ x ∧ x = false € [ i j ] – Exhaustive: at least one€ is true • The cardinal€ of X is denoted: "X# € • Continuous variable: limit case when "! X$#→ ∞

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 15 € Variable combination

• Variable conjunction

X ∧Y = {xi ∧ y j }

• Variable disjunction

€ X ∨Y = {xi ∨ y j }

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 16

€ Bayesian Program

Specification • Variables

• Decomposition

• Parametrical Forms or Recursive Question

Description Preliminary Knowledge π

Identification

Program Program Experimental Data δ

Inference Question

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 17

Description

The purpose of a description is to specify an effective method to compute a joint distribution on a set of variables: {X1, X 2 ,..., X n} given some preliminary knowledge π and a set of experimental data δ. € This joint distribution is denoted as:

P(X1 ∧ X 2 ∧...∧ X n |δ ∧π)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 18

Decomposition Partition in K subsets: Li ≠ ∅ Li = Xi1 ∧ Xi2 ∧... Conjunction rule: 1 2 n € P(X ∧ X ∧...∧ X |δ ∧π) = P(L1 |δ ∧π) × P(L2 | L1 ∧δ ∧π) ×...× P(Lk | Lk−1 ∧...∧L1 ∧δ ∧π) Conditional independence hypotheses: Ri ⊂ Li P Li | Li−1 ∧...∧L1 ∧δ ∧π € ( ) = P(Li | Ri ∧δ ∧π) Decomposition: P(X1 ∧ X 2 ∧...∧ X n |δ ∧π) € = P L1 |δ ∧π × P L2 | R2 ∧δ ∧π ×...× P Lk | Rk ∧δ ∧π ( ) ( ) ( ) Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 19

€ Indépendance et indépendance conditionnelle • Indépendance – P(X Y) = P(X) P(Y) – P(X | Y) = P(X) • Indépendance conditionnelle – P(X Y | Z) = P(X | Z) P(Y | Z) – P(X | Y Z) = P(X | Z) – P(Y | X Z) = P(Y | Z)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 20

Independence vs Conditional Independence

Indépendance mais pas indépendance conditionnelle :

I0 indépendant de F0 : P(F0 | I0) = P(F0) I0 pas indépendant de F0, conditionnellement à S0 : P(F0 | I0 S0) ≠ P(F0 | S0)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 21

Independence vs Conditional Independence

Indépendance conditionnelle mais pas indépendance :

S2 indépendant de C0, conditionnellement à O0 : P(S2 | C0 O0) = P(S2 | O0) S2 pas indépendant de C0 : P(S2 | C0) ≠ P(S2)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 22

The importance of Conditional Independence

• Nombre de probabilités (≠ nb param) – Avant hypothèses d’indépendance conditionnelle

P (I I I F ... O O ) 19 63 18 0 1 3 0 2 3 11 ≅ 2 ≅ 9.2 x 10 – Après hypothèses P (I I I F ... O O ) 0 1 3 0 2 3 = P (I0)P (I1)P (I3) (11x11) + (113x4) + (115x4) 218 P (F0)P (F1)P (F2)P (F3) ≅ 218 = 262 144 P (C0)P (C1)P (C2)P (C3) P (S I F )P (S I F )P (S O F )P (S I F ) 0 | 0 0 1 | 0 1 2 | 0 2 3 | 3 3 P (O I I S C )P (O I I S C ) 0 | 0 1 0 0 1 | 0 1 1 1 P (O O O S C )P (O I O S C ) 2 | 0 1 2 2 3 | 3 2 3 3

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 23

Bayesian Program

Specification • Variables

• Decomposition

• Parametrical Forms or Recursive Question

Description Preliminary Knowledge π

Identification

Program Program Experimental Data δ

Inference Question

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 24

Parametrical Forms or Recursive Questions

Parametrical form:

P Li | Ri ∧δ ∧π = f Li ( ) µ(Ri,δ)( )

Recursive Question: € P(Li | Ri ∧δ ∧π) = P(Li | Ri ∧δ % ∧π %) - modular and hierarchical programs - (or coherence variables) €

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 25

« Vocabulaire probabiliste »

• Démo Mathematica

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 26

Bayesian Program

Specification • Variables

• Decomposition

• Parametrical Forms or Recursive Question

Description Preliminary Knowledge π

Identification

Program Program Experimental Data δ

Inference Question

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 27

Translating knowledge into π?

• No unique manner – Limiting the domain to [a,b] = setting a parametric form with probability 0 outside of [a,b] – Conditional independence hypothesis • Explicit in the decomposition • Implicit in the parametric form

0,1 0,2 0,1 0,4 0,2 0,1 0,2 0,1 0,4 0,2 0,1 0,2 0,1 0,4 0,2

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 28

Bayesian Program

Specification • Variables

• Decomposition

• Parametrical Forms or Recursive Question

Description Preliminary Knowledge π

Identification

Program Program Experimental Data δ

Inference Question

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 29

Bayesian Program

Specification • Variables

• Decomposition

• Parametrical Forms or Recursive Question

Description Preliminary Knowledge π

Identification

Program Program Experimental Data δ

Inference Question

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 30

Question

Given a description, a question is obtained by partitioning the set of variables into 3 subsets: the searched variables (not empty), the known variables and the free variables.

We define the Search, Known and Free as the conjunctions of the variables belonging to these three sets.

We define the corresponding question as the distribution:

P(Search | Known∧δ ∧π)

€ Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 31

How to choose the question to solve?

• Non systematic choice… • Compute P(Search | Known δ π)

– Draw at random s ß drawS P(Search | Known δ π)

– Maximize probability s ß maxS P(Search | Known δ π) – Multiply with cost function and minimize expected loss • = Multiply with reward function and maximize expected gain • (Bayesian decision theory) • Compute

– P(X1 X2 | X4 δ π)

– or first P(X1 | X4 δ π) then P(X2 | X4 δ π)?

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 32

Inférence probabiliste : réponse théorique • Théorème – Si on connaît la distribution conjointe

P(X1 X2 … Xn | π) – Alors on peut calculer n'importe quelle « question »

P(X1 | [Xn = xn] π)

P(X2 X4 | [X3 = x3] π)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 33

Inférence probabiliste : réponse théorique

P (Search | known ∧ δ ∧ π ) = ∑ P (Search ∧ Free | known ∧ δ ∧ π ) Free

∑ P (Search ∧ known ∧ Free | δ ∧ π ) = Free P(known | δ π) ≠ 0 P (known | δ ∧ π ) !

∑ P (Search ∧ Free ∧ known | δ ∧ π ) = Free ∑ P (Search ∧ Free ∧ known | δ ∧ π ) Search∧Free

1 = × ∑ P (Search ∧ Free ∧ known | δ ∧ π ) Z Free

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 34

Inférence probabiliste : en pratique • Inférence dans le cas général – NP-difficile (Cooper, 90) • Deux problèmes d’optimisation – Draw (P(Search | Known∧δ ∧π)) – P (Search | Known∧δ ∧π) 1 € = × ∑P(Search∧Known∧Unknown |δ ∧π) Z Free

€ Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 35

Inférence probabiliste

• Méthodes générales d’optimisation – Méthode de Monte Carlo • MCMC Monte Carlo • Métropolis, Métropolis-Hastings • Gibbs sampling • Solution efficace problème dépendante – Filtre à particule • Solution analytique problème dépendante – Filtre de Kalman

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 36

Inférence probabiliste : moteur d’inférence

http://probabilistic-programming.org/wiki/Home

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 37

Inférence probabiliste : importance du modèle • Hypothèses d’indépendance conditionnelle – Réduisent l’espace du modèle – Réduit aussi le temps d’inférence • Sommation imbriquées • Petits espaces de sommation • Modèle modulaire, modèle hiérarchique – Programmation Bayésienne structurée

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 38

Plan

• Summary & questions! • Bayesian Programming methodology – Variables – Decomposition & conditional independence hypotheses – Parametric forms (demo) – Learning – Inference • Taxonomy of Bayesian models

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 39

Synonymie : une chose, plusieurs noms

• Kalman Filters • Bayesian networks – Linear-gaussian state-space model – Belief networks – Linear dynamical system – Generative models • Dynamic – Recursive graphical models – Dynamic belief network – DPIN directed probabilistic inference networks – Temporal belief network – Causal (belief) network • Markov Localisation – Probabilistic (causal) network – Filtre bayésien • Markov Random Fields – Input-output HMM – UPIN undirected probabilistic • State-space model inference networks – Continuous HMM – Undirected • Auto-regressive HMM – Markov networks – Correlation HMM – Log-linear models – Conditionnally gaussian HMM • Gibbs distribution switching regression model • Maxent models – Switching markov model – Switching regression model

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 40

Polysémie : un nom, plusieurs choses

• Filtres Bayésiens

– Avec variable de contrôle Ut

– Sans variables de contrôle Ut • Filtres de Kalman

– Avec variable de contrôle Ut

– Sans variables de contrôle Ut

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 41

First-order Propositional model

Probabilistic Object-oriented Knowledge based relational models Bayes nets model construction

Outcome Space relational proofs, tuples of ground terms structures nested data structures

Specificity IBAL SLPs full distribution constraints Parameterization Halpern’s logic, PLPs CPDs weights

RMNs, Decomposition Markov logic

independent probabilistic choices dependencies

Set of Objects PHA, ICL, PRISM, LPADs known unknown

BUGS, RBNs, BLPs, PRMs, BLOG, MEBN DAPER models

Fig. 1. A taxonomy of first-order probabilistic languages.

Milch, B. and Russell, S. (2007). First-order probabilistic languages: Into the unknown. In predicateInductiveAccepted Logic isProgramming a family of binary-valued, pages 10–24. random Springer. variables Ai, indexed by natural numbers i that represent papers. Similarly, the function PrimaryAuthor can Julien be represented Diard — as LPNC-CNRS an indexed family of random variables Pi, whose values are natural numbers representing researchers. Thus, instantiations of a set of random Cours variables EDISCE/EDMSTII can represent - M2R relational Sciences structures. Cognitives, Indexed « familiesCognition of randombayésienne » — 2015 42 variables are a basic modeling element in the BUGS system [37], where they are represented graphically using “plates” that contain co-indexed nodes. There are two well-known FOPLs whose possible outcomes are not relational structures in the sense we have defined. One is stochastic logic programs (SLPs) [17]. An SLP defines a distribution over proofs from a given logic program. If a particular goal predicate R is specified, then an SLP also defines a distribution over tuples of logical terms: the probability of a tuple (t1,...,tk) is the sum of the of proofs of R(t1,...,tk). SLPs are useful for defining distributions over objects that can be encoded as terms, such as strings or trees; they can also emulate more standard FOPLs [31]. The other prominent FOPL with a unique space is IBAL [26], a programming language that allows stochastic choices. An IBAL program defines a distribution over environments that map symbols to values. These values may be individual symbols, like the values of variables in a BN; but they may also be other environments, or even functions. This analysis defines the top level of the taxonomy shown in Figure 1. In the rest of the paper, we will focus on languages that define probability distributions over relational structures. First-order Propositional model Probabilistic Logic

K. Murphy. Dynamic Bayesian Networks: Representation, Inference and Learning. Ph. D. thesis, University of California, Berkeley, Berkeley, CA, July 2002.

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 43

S. Roweis and Z. Ghahramani. A unifying review of linear gaussian models. Neural Computation, 11(2):305–345, February 1999.

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 44

First-order Propositional model Probabilistic Logic

Factor Graphs • Réseaux bayésiens Prob. FG • Réseaux bayésiens dynamiques • Filtres bayésiens • Modèles de Markov Cachés • Filtres de Kalman • Processus de décision markovien (partiellement observable) • …

J. Diard, P. Bessière, and E. Mazer. A survey of probabilistic models, using the bayesian programming methodology as a unifying framework. In The Second International Conference on Computational Intelligence, and Autonomous Systems (CIRAS 2003), Singapore, December 2003.

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 45

Factor Graphs

• Bipartite graph representing the factorization

of a function m g(X , X ,...,X ) = f (S ), with S X , X ,...,X 1 2 n j j j ✓ { 1 2 n} • Example Yj=1

g(X1, X2, X3)

= f1(X1) f2(X1, X2)

f3(X1, X2) f4(X2, X3)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 46

Probabilistic Factor Graphs

• Each fi is a P(.) • No constraint relative to Bayes’ theorem • P (X X ) = P(X X )P(X X ) 1 2 1 | 2 2 | 1 – is a valid Probabilistic FG – is not a valid probabilistic model à Probabilistic FG is a strict superset of the set of probabilistic models

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 47

Bayesian Networks

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 48

Exercice : Existe-t-il des décompositions valides qui ne sont pas Bayesian Networks représentables par un DAG ?

• Directed Acyclic Graph E (DAG) – Correspond à une décomposition valide • Structure RA GL AC – analyser les (in)dépendances locales (d-séparation, etc) IR FL

Judea Pearl, Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference (1988) Steffen Lauritzen, Graphical Models (1996) Michael Jordan, Learning in Graphical Models (1998) Brendan Frey, Graphical Models for Machine Learning and Digital Communication (1998)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 49

E query Bayesian Networks inférence RA GL AC

IR evidence • Inférence exacte FL P(E | [IR=i] [FL=f]) – Message passing • propagation locale de distributions • clique tree, junction tree, etc. • Inférence approximée – Importance sampling, loopy , variational methods

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 50

Bayesian Networks E apprentissage RA GL AC

• Apprentissage de paramètres IR FL – Tout observé (facile) – Variables manquantes : Expectation-Maximisation (EM) • Espérance sur les variables manquantes sachant les variables observées • Modèle de maximum de probabilité en supposant que les variables manquantes ont leur valeur espérée • Apprentissage de structure – Recovery algorithm (distinguishability of local structure) – Iterative methods: • Start from a given structure (e.g., fully connected) • Generate a variation, evaluate it, accept it if it is better • Iterate until convergence

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 51

Dynamic Bayesian Networks

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 52

Dynamic Bayesian Network

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 53

(recursive) Bayesian Filters

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 54

(recursive) Bayesian Filters

Modèle global

Modèle local (stationnaire) Hypothèse de Markov d'ordre 1

prior ! « appris »

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 55

Recursive (incremental) computation for filtering

P(S t | O 0:t−1 ) = ∑[P(S t | S t−1 )× P(S t−1 | O 0:t−1 )] S t−1

€ P(S t | O 0:t ) = P(O t | S t )× P(S t | O 0:t−1 )

€ Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 56

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 57

P(S0 | O0)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 58

P(S1 | O0) =∑[P(S1 | S0) × P(S0 | O0)] S0

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 59

P(S1 | O1:0) = P(O1 | S1) × P(S1 | O0)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 60

P(S2 | O0:1) =∑[P(S2 | S1) × P(S1 | O0:1)] S1

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 61

P(S2 | O0:2) = P(O2 | S2) × P(S2 | O0:1)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 62

P(S3 | O0:2) =∑[P(S3 | S2) × P(S2 | O0:2)] S2

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 63

P(S3 | O0:3) = P(O3 | S3) × P(S3 | O0:2)

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 64

Hidden Markov Models

All discrete variables

Forward-backward, EM 0:T 1 T 0:T max P (S S O ) 0:T 1 S |

Julien Diard — LPNC-CNRS 8 Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 65

Kalman Filters

Inférence è produit matriciel !

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 66

Markov Localization models

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 67

(Partially Observable) Markov Decision Process

• Markov localisation

Bayesian Decision Theory

i i • Reward function R : S A R ⇥ – Cost, loss function

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 68

(Partially Observable) Markov Decision Process

• Maximiser l’espérance du gain t – Horizon infini : max Rt , with [0, 1[ R ⇥ t=0 ⇥ ⇤ • Algorithmes approximés – Policy iteration – Value iteration

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 69

Thanks for your attention!

Questions ?

Julien Diard — LPNC-CNRS Cours EDISCE/EDMSTII - M2R Sciences Cognitives, « Cognition bayésienne » — 2015 70