Lecture 1 graphical models
-
Upload
duy-tung-pham -
Category
Technology
-
view
216 -
download
2
description
Transcript of Lecture 1 graphical models
![Page 1: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/1.jpg)
04/10/2023 1
Lecture 1: Probabilistic Graphical ModelsPhạm Duy Tùng
Email: [email protected]
9/9/2012Some slides copied from Pattern Recognition and Machine Learning (Bishop 2006)
Machine Learning
![Page 2: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/2.jpg)
04/10/2023 2
Introduction
• Probabilistic graphical models • A visual presentation of probability distributions, using
diagrams, called PGMs
• Two types of PGM• Bayesian Network (Directed Graphical Model)• Markov Network (Undirected Graphical Model)
![Page 3: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/3.jpg)
04/10/2023 3
Introduction
• Offering several useful properties:• They provide a simply way to visualize the
structure of probabilistic models and motivate new models.
• Insights into the properties of the models, including the conditional independence properties, can be obtain by inspection of the graph.
• Graph based algorithms for calculation and computation
![Page 4: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/4.jpg)
04/10/2023 4
Topics
• Introduction• Representation
• Bayesian Networks (Directed Graphical Model)• Markov Networks (Undirected Graphical Model)• Converting Bayesian Networks to Markov Networks• Directed vs. Undirected Graphs
• Some examples• Naïve Bayes Classifier• Ising Model
• Inference• Learning
![Page 5: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/5.jpg)
04/10/2023 5
Representation
• Random variables -> Nodes• In Conditional Independences -> Edges
(Directed or Undirected)
Probability
Models
Graphical Models
![Page 6: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/6.jpg)
04/10/2023 6
Topics
• Introduction• Representation
• Bayesian Networks (Directed Graphical Model)• Markov Networks (Undirected Graphical Model)• Converting Bayesian Networks to Markov Networks• Directed vs. Undirected Graphs
• Some examples• Naïve Bayes Classifier• Ising Model
• Inference• Learning
![Page 7: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/7.jpg)
04/10/2023 7
Representation->Bayesian Network
• Using Directed Acyclic Graph (DAG)
• Joint distribution factorizes according to graph
![Page 8: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/8.jpg)
04/10/2023 8
Representation->Bayesian Network
![Page 9: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/9.jpg)
04/10/2023 9
Representation->Bayesian Network
• Conditional independence:
Or equivalently:
Denoted by:
![Page 10: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/10.jpg)
04/10/2023 10
Representation->Bayesian Network
• Conditional independence: Example 1
![Page 11: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/11.jpg)
04/10/2023 11
Representation->Bayesian Network
• Conditional independence: Example 1
![Page 12: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/12.jpg)
04/10/2023 12
Representation->Bayesian Network
• Conditional independence: Example 2
![Page 13: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/13.jpg)
04/10/2023 13
Representation->Bayesian Network
• Conditional independence: Example 2
![Page 14: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/14.jpg)
04/10/2023 14
Representation->Bayesian Network
• Conditional independence: Example 3
![Page 15: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/15.jpg)
04/10/2023 15
Representation->Bayesian Network
• Conditional independence: Example 3
![Page 16: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/16.jpg)
04/10/2023 16
Representation->Bayesian Network• D-separation
• A, B, and C are non-intersecting subsets of nodes in a directed graph.
• A path from A to B is blocked if it contains a node such that eithera)the arrows on the path meet either head-to-tail or tail-to-tail
at the node, and the node is in the set C, orb)the arrows meet head-to-head at the node, and neither the
node, nor any of its descendants, are in the set C.• If all paths from A to B are blocked, A is said to be d-separated
from B by C. • If A is d-separated from B by C, the joint distribution over all
variables in the graph satisfies .
![Page 17: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/17.jpg)
04/10/2023 17
Representation->Bayesian Network
• D-separation: Example
![Page 18: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/18.jpg)
04/10/2023 18
Representation->Bayesian Network
• Markov Blanket
Factors independent of xi cancel between numerator and denominator.
![Page 19: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/19.jpg)
04/10/2023 19
Example
• Mixture of Gaussians
![Page 20: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/20.jpg)
04/10/2023 20
Home Work
• LDA model (David M.Blei)
![Page 21: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/21.jpg)
04/10/2023 21
Topics
• Introduction• Representation
• Bayesian Networks (Directed Graphical Model)• Markov Networks (Undirected Graphical Model)• Converting Bayesian Networks to Markov Networks• Directed vs. Undirected Graphs
• Some examples• Naïve Bayes Classifier• Ising Model
• Inference• Learning
![Page 22: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/22.jpg)
04/10/2023 22
Representation->Markov Network
• Many phenomenon in real life, we can not determine exactly the directionality to the interaction between random variables.
• We use Markov Network to modeling these phenomenon instead of Bayesian Network.
![Page 23: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/23.jpg)
04/10/2023 23
Representation->Markov Network
Markov Blanket
• Conditional independence
![Page 24: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/24.jpg)
04/10/2023 24
Representation->Markov Network
• Factorization properties
![Page 25: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/25.jpg)
04/10/2023 25
Representation->Markov Network
Clique
Maximal Clique
• Clique
![Page 26: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/26.jpg)
04/10/2023 26
Representation->Markov Network
• where is the potential over clique C and
is the normalization coefficient; note: M K-state variables KM terms in Z.
• Energies and the Boltzmann distribution
![Page 27: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/27.jpg)
04/10/2023 27
Representation -> Converting Bayesian Networks to Markov Networks
![Page 28: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/28.jpg)
04/10/2023 28
Representation -> Converting Bayesian Networks to Markov Networks
• Additional links
![Page 29: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/29.jpg)
04/10/2023 29
Directed vs. Undirected Graphs
![Page 30: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/30.jpg)
Directed vs. Undirected Graphs
![Page 31: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/31.jpg)
04/10/2023 31
Topics• Introduction• Representation
• Bayesian Networks (Directed Graphical Model)• Markov Networks (Undirected Graphical Model)• Converting Bayesian Networks to Markov Networks• Directed vs. Undirected Graphs
• Some examples• Naïve Bayes Classifier• Ising Model
• Inference• Learning
![Page 32: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/32.jpg)
04/10/2023 32
Naïve Bayes Classifier
• Predicting
![Page 33: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/33.jpg)
04/10/2023 33
Naïve Bayes Classifier
• How to estimate and ?• Solution: We can separately estimate two
parts of the model using Maximum Likelihood
![Page 34: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/34.jpg)
04/10/2023 34
Naïve Bayes Classifier
![Page 35: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/35.jpg)
04/10/2023 35
Naïve Bayes Classifier
• Estimating • Y is discrete
Assume that Y = Where yk {0, 1} and ∈
Then we have: p(y) = log p(y)=log
![Page 36: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/36.jpg)
04/10/2023 36
Naïve Bayes Classifier
• Likelihood Function =
=• Maximum Likelihood Function
subject to Where
![Page 37: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/37.jpg)
04/10/2023 37
Naïve Bayes Classifier
• Solution for MLE problem• Using Lagrange Multiplier• Maximizing ()
• Sum over k two sides: • Then we have:
![Page 38: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/38.jpg)
04/10/2023 38
Naïve Bayes Classifier
• Estimating • Maximizing Likelihood function
![Page 39: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/39.jpg)
04/10/2023 39
Naïve Bayes Classifier
• Solution:• Assume that is discrete and similar to Y =
Where xlm {0, 1} and ∈
• p() = where • logp() = log
![Page 40: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/40.jpg)
04/10/2023 40
Naïve Bayes Classifier
• We have =• Our problem:
subject to: for m=1, …, MWhere =
![Page 41: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/41.jpg)
04/10/2023 41
Naïve Bayes Classifier
• Using Lagrange Multiplier again
• We have: =N=
![Page 42: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/42.jpg)
04/10/2023 42
Naïve Bayes Classifier
• Summary:– We have training data set (, )– Then we can estimate (Y) and (X|Y)
=
– Have new x, we can predict value of y
![Page 43: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/43.jpg)
04/10/2023 43
Naïve Bayes Classifier
• Home works:– Estimating when Y is discrete and – Design a online estimating algorithm: =f(, )– Building a recommender system using Naïve Bayes
Classifier
![Page 44: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/44.jpg)
04/10/2023 44
Ising Model and Image de-noising
• Markov Random Field
![Page 45: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/45.jpg)
04/10/2023 45
Ising Model and Image de-noising• An example of Ising Model used in Image
processing.
Original Image Noisy Image
![Page 46: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/46.jpg)
04/10/2023 46
Ising Model and Image de-noising
• Binary Images: X = (, …, ), Y = (, …, ) where {-1, +1}
• X is original image and not observed.• Y is noise-image and observed.• Suppose that the noise level is low, so there
will be a strong correlation between X and Y.• And neighbouring pixels are highly correlated.
![Page 47: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/47.jpg)
04/10/2023 47
Ising Model and Image de-noising
• All of our assumptions about images are encoded as follows:
![Page 48: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/48.jpg)
04/10/2023 48
Ising Model and Image de-noising
• The joint distribution of X, Y P(X, Y) = (*)Where: =exp{-}, (**)=- , (>0)
=exp{-}, (***)=- , (>0)
![Page 49: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/49.jpg)
04/10/2023 49
Ising Model and Image de-noising
• From (*) (**) (***) we have:P(X, Y) = exp(-E(X, Y))Where energy function E(X, Y) = -
• Using Bayes Rule: P(X|Y) • We wish to find a image X that has a high
probability
![Page 50: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/50.jpg)
04/10/2023 50
Ising Model and Image de-noising
• Solving the Maximizing Problem
=
• Some algorithms:– Iterated Conditional Models (Kittler and Foglein,
1984)– Graph cuts (Greig et al., 1989; Boykov et al., 2001;
Kolmogorov and Zabih,2004)
![Page 51: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/51.jpg)
04/10/2023 51
Ising Model and Image de-noising
• Results
Restored Image (ICM)Noisy Image
![Page 52: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/52.jpg)
04/10/2023 52
Ising Model and Image de-noising
• Comparing two optimizing algorithms: Graph cuts vs ICM
Restored Image (Graph cuts)Restored Image (ICM)
![Page 53: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/53.jpg)
04/10/2023 53
Ising Model and Image de-noising
• Home works– Design and implement an image segmentation
algorithms using Ising model.
![Page 54: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/54.jpg)
04/10/2023 54
Topics• Introduction• Representation
• Bayesian Networks (Directed Graphical Model)• Markov Networks (Undirected Graphical Model)• Converting Bayesian Networks to Markov Networks• Directed vs. Undirected Graphs
• Some examples• Naïve Bayes Classifier• Ising Model
• Inference• Learning
![Page 55: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/55.jpg)
04/10/2023 55
Inference
![Page 56: Lecture 1 graphical models](https://reader034.fdocuments.net/reader034/viewer/2022051209/548aa3afb47959a7608b47ed/html5/thumbnails/56.jpg)
04/10/2023 56
Learning