INTRODUCTION |
culprit = createCPT(list("culprit"),
probs = c(0.2, 0.8),
levelsList = list(c("butler","cook")))
culprit
probs culprit
1 0.2 butler
2 0.8 cook
culprit = createCPT(list("culprit"),
probs = c(0.2, 0.8),
levelsList = list(c("butler","cook")))
culprit
probs culprit
1 0.2 butler
2 0.8 cook
weapon.culprit = createCPT(list("weapon","culprit"),
probs = c(0.80,0.05,0.10,0.65,0.10,0.30),
levelsList = list(c("pistol","knife","poker"),
c("butler","cook")))
weapon.culprit
probs weapon culprit
1 0.80 pistol butler
2 0.05 pistol cook
3 0.10 knife butler
4 0.65 knife cook
5 0.10 poker butler
6 0.30 poker cook
culprit = createCPT(list("culprit"),
probs = c(0.2, 0.8),
levelsList = list(c("butler","cook")))
culprit
probs culprit
1 0.2 butler
2 0.8 cook
weapon.culprit = createCPT(list("weapon","culprit"),
probs = c(0.80,0.05,0.10,0.65,0.10,0.30),
levelsList = list(c("pistol","knife","poker"),
c("butler","cook")))
weapon.culprit
probs weapon culprit
1 0.80 pistol butler
2 0.05 pistol cook
3 0.10 knife butler
4 0.65 knife cook
5 0.10 poker butler
6 0.30 poker cook
productFactor(culprit,weapon.culprit)
probs culprit weapon
1 0.16 butler pistol
2 0.02 butler knife
3 0.02 butler poker
4 0.04 cook pistol
5 0.52 cook knife <--MEDIA_HYPE (looks like the cook did it with the knife!)
6 0.24 cook poker
> murderNet = list("culprit" = culprit, "weapon.culprit" = weapon.culprit )
> murderNet
$culprit
probs culprit
1 0.2 butler
2 0.8 cook
$weapon.culprit
probs weapon culprit
1 0.80 pistol butler
2 0.05 pistol cook
3 0.10 knife butler
4 0.65 knife cook
5 0.10 poker butler
6 0.30 poker cook
marginalize(murderNet, "weapon")
$culprit
probs culprit
0.2 butler
0.8 cook
> marginalize(murderNet, "culprit")
weapon probs
knife 0.54
pistol 0.20
poker 0.26
murderNet
$culprit
probs culprit
1 0.2 butler
2 0.8 cook
$weapon.culprit
probs weapon culprit
1 0.80 pistol butler
2 0.05 pistol cook
3 0.10 knife butler
4 0.65 knife cook
5 0.10 poker butler
6 0.30 poker cook
observe(murderNet, "weapon", "pistol")
$culprit
probs culprit
1 0.2 butler
2 0.8 cook
* Partial knowledge of the world
* Noisy observation
* Phenomenon not convered by model
* Inherent stochasticity
* Declarative representation with clear semantics
* Reasoning patterns, For Eg Conditioning
* Established learning methods
Spec of a BN
* We need to define its Parameters.
* These Parameters are the Conditional Probabilities
of each node given
its parents in the graph.
If we consider discrete variables:
* Root nodes : Cector of marginal probabilities.
* Other nodes : Conditional Probability Table (CPT)
of the variable given
its parents in the graph.
Graph Theory
* Intuitive & compact data structures
* Efficient reasoning using general purpose algorithms
* Sparse parameterization
* feasible elicitations (by hand)
* learning from data (auto)
Combined Probability Theory with Graph Theory
* New insights into existing models
* Framework for designing new models
* Graph-based algo's for calculation and computations
* Feynman diagrams in Physics
* Efficient software implementation
b = createCPT(list("battery"), probs = c(0.9, 0.1), levelsList = list(c(1, 0)))
f = createCPT(list("fuel"), probs = c(0.9, 0.1), levelsList = list(c(1, 0)))
g.bf = createCPT(list("gauge", "battery", "fuel"),
probs = c(0.8, 0.2, 0.2, 0.1, 0.2, 0.8, 0.8, 0.9),
levelsList = list(c(1, 0), c(1, 0), c(1, 0)))
carNet = list("battery" = b, "fuel" = f, "gauge" = g.bf)
G=0
> infer(carNet, c("battery", "fuel"), NULL, NULL)
gauge probs
1 0 0.315
2 1 0.685
> infer(carNet, c("battery"), "fuel", 0)
probs fuel gauge
1 0.81 0 0
2 0.19 0 1
> infer(carNet, c("battery"), "gauge", 0)
probs fuel gauge
1 0.2571429 0 0
2 0.7428571 1 0
> infer(carNet, NULL, c("gauge", "battery"), c(0, 0))
probs battery gauge fuel
1 0.1111111 0 0 0
2 0.8888889 0 0 1
4 steps for inference
* Building up factors needed for bayes rule, trick is to rearrange terms
* Conceptually simple, naive , but works for any possbile bayes net.
Multiplication
productFactor(A, B)
Marginalize
marginalizeFactor(A, margVar)
marginalize(bayesNet, margVars)
Observe
observe(bayesNet, obsVars, obsVals)
Infer
infer(bayesNet, margVars, obsVars, obsVals)
Build a model:
Incorporate the observed data
Compute the distributions over the desired variables: inference
Iterate 2 and 3 in real-time applications
Extend model as required
- Clique factorization
Source:
Advances in Computer Vision and Pattern Recognition
ISBN 978-1-4471-6699-3 (eBook)
DOI 10.1007/978-1-4471-6699-3
* All PGMs can be represented as Graphs G=(V,E)
that define the structure of the model
* Local f() that describe its parameters
* The type of graph and the local f()
vary from different types of model
model
and some evidence
.
* Obtaining the `posterior` probability distribution of
a `variable` or *set* of `variables`
given that other variables in the model are known.
* The research problem is how to do this efficiently.?
* Pearls Algorithm
* Variable Elimination
* Conditioning
* Junction Tree
* Stochastic Simulation
* Not so good news
* In the worst case, Inference is NP-hard
* Its a pain and $$ to do it with the aid of Experts.
* Obtaining the parameters for the models
usually done based on data.
* Humans tend to be bad estimators of probabilities.
1. What data do we want to use for learning
2. What do we want to learn
3. How are we going to learn it
By Hand (elicitation)
By Data (statistical methods)
4. Build PGM
Root Nodes : ?
Other Nodes : ?
Edges: Probabilistic connections
5. What do we want to infer
How -> TensorFlow - Edward lib
What are the evidence we have - PIN data
1. What data do we want to use for learning
2. What do we want to learn
3. How are we going to learn it
By Hand (elicitation)
By Data (statistical methods)
4. Build PGM
Root Nodes : ?
Other Nodes : ?
Edges: Probabilistic connections
5. What do we want to infer
How -> TensorFlow - Edward lib
What are the evidence we have - DOE Mini Apps
PGM + First Order Logic
Applies the ideas of a Markov network to first-order logic.
Enabling uncertain inference.
in the sense that, in a certain limit,
all unsatisfiable statements have a probability of zero,
and all tautologies have probability one.
Pedro Domingos and Matt Richardson,
Use the term MLN to describe it
mcmc()
gs()
mh()
hmc()