SlideShare a Scribd company logo
1 of 35
Download to read offline
Scalable MAP inference in Bayesian
networks based on a Map-Reduce
approach
Darío Ramos-López1, Antonio Salmerón1, Rafael Rumí1,
Ana M. Martínez2, Thomas D. Nielsen2, Andrés R. Masegosa3,
Helge Langseth3, Anders L. Madsen2,4
1Department of Mathematics, University of Almería, Spain
2Department of Computer Science, Aalborg University, Denmark
3 Department of Computer and Information Science,
The Norwegian University of Science and Technology, Norway
4 Hugin Expert A/S, Aalborg, Denmark
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 1
Outline
1 Motivation
2 MAP in CLG networks
3 Scalable MAP
4 Experimental results
5 Conclusions
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 2
Outline
1 Motivation
2 MAP in CLG networks
3 Scalable MAP
4 Experimental results
5 Conclusions
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 3
Motivation
Aim: Provide scalable solutions to the MAP problem.
Challenges:
Data coming in streams at high speed, and
a quick response is required.
For each observation in the stream, the
most likely configuration of a set of
variables of interest is sought.
MAP inference is highly complex.
Hybrid models come along with specific
difficulties.
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 4
Context
The AMiDST project: Analysis of MassIve Data STreams
http://www.amidst.eu
Large number of variables
Queries to be answered in real time
Hybrid Bayesian networks (involving discrete and continuous
variables)
Conditional linear Gaussian networks
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 5
Outline
1 Motivation
2 MAP in CLG networks
3 Scalable MAP
4 Experimental results
5 Conclusions
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 6
Conditional Linear Gaussian networks
Y
W
TU
S
P(Y ) = (0.5, 0.5)
P(S) = (0.1, 0.9)
f (w|Y = 0) = N(w; −1, 1)
f (w|Y = 1) = N(w; 2, 1)
f (t|w, S = 0) = N(t; −w, 1)
f (t|w, S = 1) = N(t; w, 1)
f (u|w) = N(u; w, 1)
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 7
Querying a Bayesian network
Belief update: Computing the posterior distribution of a variable:
p(xi |xE ) =
xD
xC
p(x, xE )dxC
xDi
xCi
p(x, xE )dxCi
Maximum a posteriori (MAP): For a set of target variables XI , seek
x∗
I = arg max
xI
p(xI |XE = xE )
where p(xI |XE = xE ) is obtained by first marginalizing out from
p(x) the variables not in XI and not in XE
Most probable explanation (MPE): A particular case of MAP where
XI includes all the unobserved variables
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 8
Querying a Bayesian network
Belief update: Computing the posterior distribution of a variable:
p(xi |xE ) =
xD
xC
p(x, xE )dxC
xDi
xCi
p(x, xE )dxCi
Maximum a posteriori (MAP): For a set of target variables XI , seek
x∗
I = arg max
xI
p(xI |XE = xE )
where p(xI |XE = xE ) is obtained by first marginalizing out from
p(x) the variables not in XI and not in XE
Most probable explanation (MPE): A particular case of MAP where
XI includes all the unobserved variables
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 8
Outline
1 Motivation
2 MAP in CLG networks
3 Scalable MAP
4 Experimental results
5 Conclusions
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 9
MAP by Hill Climbing
HC_MAP(B,xI ,xE ,r)
while stopping criterion not satisfied do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
if p(x∗
I , xE ) ≥ p(xI , xE ) then
xI ← x∗
I
end
end
return xI
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
MAP by Hill Climbing
HC_MAP(B,xI ,xE ,r)
while stopping criterion not satisfied do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
if p(x∗
I , xE ) ≥ p(xI , xE ) then
xI ← x∗
I
end
end
return xI
Max. number of non-improving iterations
Target prob. threshold
Max. number of iterations
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
MAP by Hill Climbing
HC_MAP(B,xI ,xE ,r)
while stopping criterion not satisfied do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
if p(x∗
I , xE ) ≥ p(xI , xE ) then
xI ← x∗
I
end
end
return xI
Never move to a worse configuration
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
MAP by Hill Climbing
HC_MAP(B,xI ,xE ,r)
while stopping criterion not satisfied do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
if p(x∗
I , xE ) ≥ p(xI , xE ) then
xI ← x∗
I
end
end
return xI
Estimated using importance sampling:
p(xI , xE ) =
x∗∈ΩX∗
p(xI , xE , x∗
) =
x∗∈ΩX∗
p(xI , xE , x∗
)
f ∗(x∗)
f ∗
(x∗
)
= Ef ∗
p(xI , xE , x∗
)
f ∗(x∗)
≈
1
n
n
i=1
p xI , xE , x∗(i)
f ∗ x∗(i)
,
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
MAP by Hill Climbing
HC_MAP(B,xI ,xE ,r)
while stopping criterion not satisfied do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
if p(x∗
I , xE ) ≥ p(xI , xE ) then
xI ← x∗
I
end
end
return xI
We’ll see later
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
MAP by Simulated Annealing
SA_MAP(B,xI ,xE ,r)
T ← 1 000; α ← 0.90; ε > 0
while T ≥ ε do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
Simulate a random number τ ∼ U(0, 1)
if p(x∗
I , xE ) > p(xI , xE )/(T · ln(1/τ)) then
xI ← x∗
I
end
T ← α · T
end
return xI
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
MAP by Simulated Annealing
SA_MAP(B,xI ,xE ,r)
T ← 1 000; α ← 0.90; ε > 0
while T ≥ ε do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
Simulate a random number τ ∼ U(0, 1)
if p(x∗
I , xE ) > p(xI , xE )/(T · ln(1/τ)) then
xI ← x∗
I
end
T ← α · T
end
return xI
Default values of the temperature parameters
T 1: almost completely random
T 1: almost completely greedy
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
MAP by Simulated Annealing
SA_MAP(B,xI ,xE ,r)
T ← 1 000; α ← 0.90; ε > 0
while T ≥ ε do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
Simulate a random number τ ∼ U(0, 1)
if p(x∗
I , xE ) > p(xI , xE )/(T · ln(1/τ)) then
xI ← x∗
I
end
T ← α · T
end
return xI
Accept x∗
I if its prob. increases
or decreases < T · ln(1/τ)
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
MAP by Simulated Annealing
SA_MAP(B,xI ,xE ,r)
T ← 1 000; α ← 0.90; ε > 0
while T ≥ ε do
x∗
I ← GenerateConfiguration(B, xI , xE , r)
Simulate a random number τ ∼ U(0, 1)
if p(x∗
I , xE ) > p(xI , xE )/(T · ln(1/τ)) then
xI ← x∗
I
end
T ← α · T
end
return xI
Cool down the temperature
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
Generating a new configuration of variables
Only discrete variables
The new values are chosen at random
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 12
Generating a new configuration of variables
Hybrid models
We take advantage of the properties of the CLG distribution
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 12
Generating a new configuration of variables
Hybrid models
We take advantage of the properties of the CLG distribution
A variable whose parents are discrete or observed
Y
W
TU
S
P(Y ) = (0.5, 0.5)
P(S) = (0.1, 0.9)
f (w|Y = 0) = N(w; −1, 1)
f (w|Y = 1) = N(w; 2, 1)
f (t|w, S = 0) = N(t; −w, 1)
f (t|w, S = 1) = N(t; w, 1)
f (u|w) = N(u; w, 1)
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 12
Generating a new configuration of variables
Hybrid models
We take advantage of the properties of the CLG distribution
A variable whose parents are discrete or observed
Y
W
TU
S
Return its conditional mean:
f (w|Y = 0) = N(w; −1, 1)
f (w|Y = 1) = N(w; 2, 1)
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 13
Generating a new configuration of variables
Hybrid models
We take advantage of the properties of the CLG distribution
A variable with unobserved continuous parents
Y
W
TU
S
Simulate a value using
its conditional distribution:
f (t|w, S = 0) = N(t; −w, 1)
f (t|w, S = 1) = N(t; w, 1)
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 13
Scalable implementation
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 14
Outline
1 Motivation
2 MAP in CLG networks
3 Scalable MAP
4 Experimental results
5 Conclusions
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 15
Experimental analysis
Purpose
Analyze the scalability in terms of
Speed
Accuracy
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 16
Experimental analysis
Purpose
Analyze the scalability in terms of
Speed
Accuracy
Experimental setup
Synthetic networks with 200 variables (50% discrete)
70% of the variables observed at random
10% of the variables selected as target ⇒ 20% to be
marginalized out
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 16
Experimental analysis
Computing environment
AMIDST Toolbox with Apache Flink
Multi-core environment based on a dual-processor AMD
Opteron 2.8 GHz server with 32 cores and 64 GB of RAM,
running Ubuntu Linux 14.04.1 LTS
Multi-node environment based on Amazon Web Services
(AWS)
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 17
Scalability: run times
100
200
300
400
500
600
1 2 4 8 16 24 32
Number of cores
Executiontime(s)
method HC Global HC Local SA Global SA Local
Scalability of MAP in a multi−core node
5
10
15
Speed-upfactor
5
10
15
20
1 2 4 8 16 24 32
Number of nodes (4 vCPUs per node)Speed−upfactor
method HC Global HC Local SA Global SA Local
Scalability of MAP in a multi−node cluster
25
50
75
100
125
1 2 4 8 16 24 32
Number of nodes (4 vCPUs per node)Executiontime(s)
method HC Global HC Local SA Global SA Local
Scalability of MAP in a multi−node cluster
5
10
15
20
Speed-upfactor
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 18
Scalability: accuracy (Simulated Annealing)
−230
−220
−210
−200
−190
1 2 4 8 16 32
Number of cores
logProbability
cores
1
2
4
8
16
32
Simulated Annealing global
−200
−195
−190
−185
1 2 4 8 16 32
Number of cores
logProbability
cores
1
2
4
8
16
32
Simulated Annealing local
Estimated log-probabilities of the MAP configurations found by each algorithm
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 19
Scalability: accuracy (Hill Climbing)
−240
−220
−200
1 2 4 8 16 32
Number of cores
logProbability
cores
1
2
4
8
16
32
Hill Climbing global
−240
−220
−200
1 2 4 8 16 32
Number of cores
logProbability
cores
1
2
4
8
16
32
Hill Climbing local
Estimated log-probabilities of the MAP configurations found by each algorithm
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 20
Outline
1 Motivation
2 MAP in CLG networks
3 Scalable MAP
4 Experimental results
5 Conclusions
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 21
Conclusions
Scalable MAP for CLG models in terms of accuracy and run
time
Available in the AMIDST Toolbox
Valid for multi-cores and cluster systems
MapReduce-based design on top of Apache Flink
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 22
Thank you for your attention
You can download our open source Java toolbox:
http://www.amidsttoolbox.com
Acknowledgments: This project has received funding from the European Union’s
Seventh Framework Programme for research, technological development and
demonstration under grant agreement no 619209
8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 23

More Related Content

What's hot

Riemannian gossip algorithms for decentralized matrix completion
Riemannian gossip algorithms for decentralized matrix completionRiemannian gossip algorithms for decentralized matrix completion
Riemannian gossip algorithms for decentralized matrix completion
Bamdev Mishra
 

What's hot (20)

QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
A Unifying Review of Gaussian Linear Models (Roweis 1999)
A Unifying Review of Gaussian Linear Models (Roweis 1999)A Unifying Review of Gaussian Linear Models (Roweis 1999)
A Unifying Review of Gaussian Linear Models (Roweis 1999)
 
Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization ProblemElementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
 
Climate Extremes Workshop - A Semiparametric Bayesian Clustering Model for S...
Climate Extremes Workshop -  A Semiparametric Bayesian Clustering Model for S...Climate Extremes Workshop -  A Semiparametric Bayesian Clustering Model for S...
Climate Extremes Workshop - A Semiparametric Bayesian Clustering Model for S...
 
Numerical methods for variational principles in traffic
Numerical methods for variational principles in trafficNumerical methods for variational principles in traffic
Numerical methods for variational principles in traffic
 
Atomic algorithm and the servers' s use to find the Hamiltonian cycles
Atomic algorithm and the servers' s use to find the Hamiltonian cyclesAtomic algorithm and the servers' s use to find the Hamiltonian cycles
Atomic algorithm and the servers' s use to find the Hamiltonian cycles
 
Generalized Low Rank Models
Generalized Low Rank ModelsGeneralized Low Rank Models
Generalized Low Rank Models
 
H2O World - GLRM - Anqi Fu
H2O World - GLRM - Anqi FuH2O World - GLRM - Anqi Fu
H2O World - GLRM - Anqi Fu
 
OXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriringOXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriring
 
Contribution à l'étude du trafic routier sur réseaux à l'aide des équations d...
Contribution à l'étude du trafic routier sur réseaux à l'aide des équations d...Contribution à l'étude du trafic routier sur réseaux à l'aide des équations d...
Contribution à l'étude du trafic routier sur réseaux à l'aide des équations d...
 
Hokusai - Sketching streams in real time
Hokusai - Sketching streams in real timeHokusai - Sketching streams in real time
Hokusai - Sketching streams in real time
 
Riemannian gossip algorithms for decentralized matrix completion
Riemannian gossip algorithms for decentralized matrix completionRiemannian gossip algorithms for decentralized matrix completion
Riemannian gossip algorithms for decentralized matrix completion
 
Topographic graph clustering with kernel and dissimilarity methods
Topographic graph clustering with kernel and dissimilarity methodsTopographic graph clustering with kernel and dissimilarity methods
Topographic graph clustering with kernel and dissimilarity methods
 
Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space
 
A review on structure learning in GNN
A review on structure learning in GNNA review on structure learning in GNN
A review on structure learning in GNN
 
k-MLE: A fast algorithm for learning statistical mixture models
k-MLE: A fast algorithm for learning statistical mixture modelsk-MLE: A fast algorithm for learning statistical mixture models
k-MLE: A fast algorithm for learning statistical mixture models
 
On learning statistical mixtures maximizing the complete likelihood
On learning statistical mixtures maximizing the complete likelihoodOn learning statistical mixtures maximizing the complete likelihood
On learning statistical mixtures maximizing the complete likelihood
 
Cs229 notes10
Cs229 notes10Cs229 notes10
Cs229 notes10
 
QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...
QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...
QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...
 
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesEfficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
 

Viewers also liked (7)

Diplom Passing Cert.
Diplom Passing Cert.Diplom Passing Cert.
Diplom Passing Cert.
 
Reverse Mortgage Purchase Loans
Reverse Mortgage Purchase LoansReverse Mortgage Purchase Loans
Reverse Mortgage Purchase Loans
 
Firmar daniel vsv
Firmar daniel vsvFirmar daniel vsv
Firmar daniel vsv
 
Eda filming ethics checklist
Eda filming ethics checklistEda filming ethics checklist
Eda filming ethics checklist
 
Firma elías
Firma elíasFirma elías
Firma elías
 
Social Media Do's and Don'ts
Social Media Do's and Don'tsSocial Media Do's and Don'ts
Social Media Do's and Don'ts
 
Ejemplo de Propuesta para empresa
Ejemplo de Propuesta para empresa Ejemplo de Propuesta para empresa
Ejemplo de Propuesta para empresa
 

Similar to Scalable MAP inference in Bayesian networks based on a Map-Reduce approach (PGM2016)

Projection methods for stochastic structural dynamics
Projection methods for stochastic structural dynamicsProjection methods for stochastic structural dynamics
Projection methods for stochastic structural dynamics
University of Glasgow
 

Similar to Scalable MAP inference in Bayesian networks based on a Map-Reduce approach (PGM2016) (20)

SASA 2016
SASA 2016SASA 2016
SASA 2016
 
One Algorithm to Rule Them All: How to Automate Statistical Computation
One Algorithm to Rule Them All: How to Automate Statistical ComputationOne Algorithm to Rule Them All: How to Automate Statistical Computation
One Algorithm to Rule Them All: How to Automate Statistical Computation
 
Accelerating Metropolis Hastings with Lightweight Inference Compilation
Accelerating Metropolis Hastings with Lightweight Inference CompilationAccelerating Metropolis Hastings with Lightweight Inference Compilation
Accelerating Metropolis Hastings with Lightweight Inference Compilation
 
Parallel Filter-Based Feature Selection Based on Balanced Incomplete Block De...
Parallel Filter-Based Feature Selection Based on Balanced Incomplete Block De...Parallel Filter-Based Feature Selection Based on Balanced Incomplete Block De...
Parallel Filter-Based Feature Selection Based on Balanced Incomplete Block De...
 
Supervised Planetary Unmixing with Optimal Transport
Supervised Planetary Unmixing with Optimal TransportSupervised Planetary Unmixing with Optimal Transport
Supervised Planetary Unmixing with Optimal Transport
 
Micro to macro passage in traffic models including multi-anticipation effect
Micro to macro passage in traffic models including multi-anticipation effectMicro to macro passage in traffic models including multi-anticipation effect
Micro to macro passage in traffic models including multi-anticipation effect
 
Regression on gaussian symbols
Regression on gaussian symbolsRegression on gaussian symbols
Regression on gaussian symbols
 
DETECTION OF MOVING OBJECT
DETECTION OF MOVING OBJECTDETECTION OF MOVING OBJECT
DETECTION OF MOVING OBJECT
 
Quasi-Optimal Recombination Operator
Quasi-Optimal Recombination OperatorQuasi-Optimal Recombination Operator
Quasi-Optimal Recombination Operator
 
Final Report-1-(1)
Final Report-1-(1)Final Report-1-(1)
Final Report-1-(1)
 
Probabilistic Modelling with Information Filtering Networks
Probabilistic Modelling with Information Filtering NetworksProbabilistic Modelling with Information Filtering Networks
Probabilistic Modelling with Information Filtering Networks
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
Metropolis-Hastings MCMC Short Tutorial
Metropolis-Hastings MCMC Short TutorialMetropolis-Hastings MCMC Short Tutorial
Metropolis-Hastings MCMC Short Tutorial
 
StatPhysPerspectives_AMALEA_Cetraro_AnnaCarbone.pdf
StatPhysPerspectives_AMALEA_Cetraro_AnnaCarbone.pdfStatPhysPerspectives_AMALEA_Cetraro_AnnaCarbone.pdf
StatPhysPerspectives_AMALEA_Cetraro_AnnaCarbone.pdf
 
CLIM: Transition Workshop - Statistical Emulation with Dimension Reduction fo...
CLIM: Transition Workshop - Statistical Emulation with Dimension Reduction fo...CLIM: Transition Workshop - Statistical Emulation with Dimension Reduction fo...
CLIM: Transition Workshop - Statistical Emulation with Dimension Reduction fo...
 
Asynchronous Stochastic Optimization, New Analysis and Algorithms
Asynchronous Stochastic Optimization, New Analysis and AlgorithmsAsynchronous Stochastic Optimization, New Analysis and Algorithms
Asynchronous Stochastic Optimization, New Analysis and Algorithms
 
QMC: Undergraduate Workshop, Introduction to Monte Carlo Methods with 'R' Sof...
QMC: Undergraduate Workshop, Introduction to Monte Carlo Methods with 'R' Sof...QMC: Undergraduate Workshop, Introduction to Monte Carlo Methods with 'R' Sof...
QMC: Undergraduate Workshop, Introduction to Monte Carlo Methods with 'R' Sof...
 
Projection methods for stochastic structural dynamics
Projection methods for stochastic structural dynamicsProjection methods for stochastic structural dynamics
Projection methods for stochastic structural dynamics
 
Rational function representation
Rational function representationRational function representation
Rational function representation
 
Logistic Regression: Behind the Scenes
Logistic Regression: Behind the ScenesLogistic Regression: Behind the Scenes
Logistic Regression: Behind the Scenes
 

More from AMIDST Toolbox

Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)
AMIDST Toolbox
 

More from AMIDST Toolbox (6)

Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)
 
Dynamic Bayesian modeling for risk prediction in credit operations (SCAI2015)
Dynamic Bayesian modeling for risk prediction in credit operations (SCAI2015)Dynamic Bayesian modeling for risk prediction in credit operations (SCAI2015)
Dynamic Bayesian modeling for risk prediction in credit operations (SCAI2015)
 
A Java Toolbox for Analysis of MassIve Data STreams using Probabilistic Graph...
A Java Toolbox for Analysis of MassIve Data STreams using Probabilistic Graph...A Java Toolbox for Analysis of MassIve Data STreams using Probabilistic Graph...
A Java Toolbox for Analysis of MassIve Data STreams using Probabilistic Graph...
 
Parallelisation of the PC Algorithm (CAEPIA2015)
Parallelisation of the PC Algorithm (CAEPIA2015)Parallelisation of the PC Algorithm (CAEPIA2015)
Parallelisation of the PC Algorithm (CAEPIA2015)
 
Amidst demo (BNAIC 2015)
Amidst demo (BNAIC 2015)Amidst demo (BNAIC 2015)
Amidst demo (BNAIC 2015)
 
Flink Forward 2016
Flink Forward 2016Flink Forward 2016
Flink Forward 2016
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
anilsa9823
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSS
LeenakshiTyagi
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
PirithiRaju
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
gindu3009
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
PirithiRaju
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
PirithiRaju
 

Recently uploaded (20)

Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on Io
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdf
 
Green chemistry and Sustainable development.pptx
Green chemistry  and Sustainable development.pptxGreen chemistry  and Sustainable development.pptx
Green chemistry and Sustainable development.pptx
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
 
Botany krishna series 2nd semester Only Mcq type questions
Botany krishna series 2nd semester Only Mcq type questionsBotany krishna series 2nd semester Only Mcq type questions
Botany krishna series 2nd semester Only Mcq type questions
 
Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATINChromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSS
 
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisRaman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Zoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfZoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdf
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRStunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 

Scalable MAP inference in Bayesian networks based on a Map-Reduce approach (PGM2016)

  • 1. Scalable MAP inference in Bayesian networks based on a Map-Reduce approach Darío Ramos-López1, Antonio Salmerón1, Rafael Rumí1, Ana M. Martínez2, Thomas D. Nielsen2, Andrés R. Masegosa3, Helge Langseth3, Anders L. Madsen2,4 1Department of Mathematics, University of Almería, Spain 2Department of Computer Science, Aalborg University, Denmark 3 Department of Computer and Information Science, The Norwegian University of Science and Technology, Norway 4 Hugin Expert A/S, Aalborg, Denmark 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 1
  • 2. Outline 1 Motivation 2 MAP in CLG networks 3 Scalable MAP 4 Experimental results 5 Conclusions 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 2
  • 3. Outline 1 Motivation 2 MAP in CLG networks 3 Scalable MAP 4 Experimental results 5 Conclusions 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 3
  • 4. Motivation Aim: Provide scalable solutions to the MAP problem. Challenges: Data coming in streams at high speed, and a quick response is required. For each observation in the stream, the most likely configuration of a set of variables of interest is sought. MAP inference is highly complex. Hybrid models come along with specific difficulties. 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 4
  • 5. Context The AMiDST project: Analysis of MassIve Data STreams http://www.amidst.eu Large number of variables Queries to be answered in real time Hybrid Bayesian networks (involving discrete and continuous variables) Conditional linear Gaussian networks 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 5
  • 6. Outline 1 Motivation 2 MAP in CLG networks 3 Scalable MAP 4 Experimental results 5 Conclusions 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 6
  • 7. Conditional Linear Gaussian networks Y W TU S P(Y ) = (0.5, 0.5) P(S) = (0.1, 0.9) f (w|Y = 0) = N(w; −1, 1) f (w|Y = 1) = N(w; 2, 1) f (t|w, S = 0) = N(t; −w, 1) f (t|w, S = 1) = N(t; w, 1) f (u|w) = N(u; w, 1) 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 7
  • 8. Querying a Bayesian network Belief update: Computing the posterior distribution of a variable: p(xi |xE ) = xD xC p(x, xE )dxC xDi xCi p(x, xE )dxCi Maximum a posteriori (MAP): For a set of target variables XI , seek x∗ I = arg max xI p(xI |XE = xE ) where p(xI |XE = xE ) is obtained by first marginalizing out from p(x) the variables not in XI and not in XE Most probable explanation (MPE): A particular case of MAP where XI includes all the unobserved variables 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 8
  • 9. Querying a Bayesian network Belief update: Computing the posterior distribution of a variable: p(xi |xE ) = xD xC p(x, xE )dxC xDi xCi p(x, xE )dxCi Maximum a posteriori (MAP): For a set of target variables XI , seek x∗ I = arg max xI p(xI |XE = xE ) where p(xI |XE = xE ) is obtained by first marginalizing out from p(x) the variables not in XI and not in XE Most probable explanation (MPE): A particular case of MAP where XI includes all the unobserved variables 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 8
  • 10. Outline 1 Motivation 2 MAP in CLG networks 3 Scalable MAP 4 Experimental results 5 Conclusions 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 9
  • 11. MAP by Hill Climbing HC_MAP(B,xI ,xE ,r) while stopping criterion not satisfied do x∗ I ← GenerateConfiguration(B, xI , xE , r) if p(x∗ I , xE ) ≥ p(xI , xE ) then xI ← x∗ I end end return xI 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
  • 12. MAP by Hill Climbing HC_MAP(B,xI ,xE ,r) while stopping criterion not satisfied do x∗ I ← GenerateConfiguration(B, xI , xE , r) if p(x∗ I , xE ) ≥ p(xI , xE ) then xI ← x∗ I end end return xI Max. number of non-improving iterations Target prob. threshold Max. number of iterations 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
  • 13. MAP by Hill Climbing HC_MAP(B,xI ,xE ,r) while stopping criterion not satisfied do x∗ I ← GenerateConfiguration(B, xI , xE , r) if p(x∗ I , xE ) ≥ p(xI , xE ) then xI ← x∗ I end end return xI Never move to a worse configuration 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
  • 14. MAP by Hill Climbing HC_MAP(B,xI ,xE ,r) while stopping criterion not satisfied do x∗ I ← GenerateConfiguration(B, xI , xE , r) if p(x∗ I , xE ) ≥ p(xI , xE ) then xI ← x∗ I end end return xI Estimated using importance sampling: p(xI , xE ) = x∗∈ΩX∗ p(xI , xE , x∗ ) = x∗∈ΩX∗ p(xI , xE , x∗ ) f ∗(x∗) f ∗ (x∗ ) = Ef ∗ p(xI , xE , x∗ ) f ∗(x∗) ≈ 1 n n i=1 p xI , xE , x∗(i) f ∗ x∗(i) , 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
  • 15. MAP by Hill Climbing HC_MAP(B,xI ,xE ,r) while stopping criterion not satisfied do x∗ I ← GenerateConfiguration(B, xI , xE , r) if p(x∗ I , xE ) ≥ p(xI , xE ) then xI ← x∗ I end end return xI We’ll see later 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 10
  • 16. MAP by Simulated Annealing SA_MAP(B,xI ,xE ,r) T ← 1 000; α ← 0.90; ε > 0 while T ≥ ε do x∗ I ← GenerateConfiguration(B, xI , xE , r) Simulate a random number τ ∼ U(0, 1) if p(x∗ I , xE ) > p(xI , xE )/(T · ln(1/τ)) then xI ← x∗ I end T ← α · T end return xI 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
  • 17. MAP by Simulated Annealing SA_MAP(B,xI ,xE ,r) T ← 1 000; α ← 0.90; ε > 0 while T ≥ ε do x∗ I ← GenerateConfiguration(B, xI , xE , r) Simulate a random number τ ∼ U(0, 1) if p(x∗ I , xE ) > p(xI , xE )/(T · ln(1/τ)) then xI ← x∗ I end T ← α · T end return xI Default values of the temperature parameters T 1: almost completely random T 1: almost completely greedy 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
  • 18. MAP by Simulated Annealing SA_MAP(B,xI ,xE ,r) T ← 1 000; α ← 0.90; ε > 0 while T ≥ ε do x∗ I ← GenerateConfiguration(B, xI , xE , r) Simulate a random number τ ∼ U(0, 1) if p(x∗ I , xE ) > p(xI , xE )/(T · ln(1/τ)) then xI ← x∗ I end T ← α · T end return xI Accept x∗ I if its prob. increases or decreases < T · ln(1/τ) 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
  • 19. MAP by Simulated Annealing SA_MAP(B,xI ,xE ,r) T ← 1 000; α ← 0.90; ε > 0 while T ≥ ε do x∗ I ← GenerateConfiguration(B, xI , xE , r) Simulate a random number τ ∼ U(0, 1) if p(x∗ I , xE ) > p(xI , xE )/(T · ln(1/τ)) then xI ← x∗ I end T ← α · T end return xI Cool down the temperature 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 11
  • 20. Generating a new configuration of variables Only discrete variables The new values are chosen at random 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 12
  • 21. Generating a new configuration of variables Hybrid models We take advantage of the properties of the CLG distribution 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 12
  • 22. Generating a new configuration of variables Hybrid models We take advantage of the properties of the CLG distribution A variable whose parents are discrete or observed Y W TU S P(Y ) = (0.5, 0.5) P(S) = (0.1, 0.9) f (w|Y = 0) = N(w; −1, 1) f (w|Y = 1) = N(w; 2, 1) f (t|w, S = 0) = N(t; −w, 1) f (t|w, S = 1) = N(t; w, 1) f (u|w) = N(u; w, 1) 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 12
  • 23. Generating a new configuration of variables Hybrid models We take advantage of the properties of the CLG distribution A variable whose parents are discrete or observed Y W TU S Return its conditional mean: f (w|Y = 0) = N(w; −1, 1) f (w|Y = 1) = N(w; 2, 1) 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 13
  • 24. Generating a new configuration of variables Hybrid models We take advantage of the properties of the CLG distribution A variable with unobserved continuous parents Y W TU S Simulate a value using its conditional distribution: f (t|w, S = 0) = N(t; −w, 1) f (t|w, S = 1) = N(t; w, 1) 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 13
  • 25. Scalable implementation 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 14
  • 26. Outline 1 Motivation 2 MAP in CLG networks 3 Scalable MAP 4 Experimental results 5 Conclusions 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 15
  • 27. Experimental analysis Purpose Analyze the scalability in terms of Speed Accuracy 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 16
  • 28. Experimental analysis Purpose Analyze the scalability in terms of Speed Accuracy Experimental setup Synthetic networks with 200 variables (50% discrete) 70% of the variables observed at random 10% of the variables selected as target ⇒ 20% to be marginalized out 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 16
  • 29. Experimental analysis Computing environment AMIDST Toolbox with Apache Flink Multi-core environment based on a dual-processor AMD Opteron 2.8 GHz server with 32 cores and 64 GB of RAM, running Ubuntu Linux 14.04.1 LTS Multi-node environment based on Amazon Web Services (AWS) 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 17
  • 30. Scalability: run times 100 200 300 400 500 600 1 2 4 8 16 24 32 Number of cores Executiontime(s) method HC Global HC Local SA Global SA Local Scalability of MAP in a multi−core node 5 10 15 Speed-upfactor 5 10 15 20 1 2 4 8 16 24 32 Number of nodes (4 vCPUs per node)Speed−upfactor method HC Global HC Local SA Global SA Local Scalability of MAP in a multi−node cluster 25 50 75 100 125 1 2 4 8 16 24 32 Number of nodes (4 vCPUs per node)Executiontime(s) method HC Global HC Local SA Global SA Local Scalability of MAP in a multi−node cluster 5 10 15 20 Speed-upfactor 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 18
  • 31. Scalability: accuracy (Simulated Annealing) −230 −220 −210 −200 −190 1 2 4 8 16 32 Number of cores logProbability cores 1 2 4 8 16 32 Simulated Annealing global −200 −195 −190 −185 1 2 4 8 16 32 Number of cores logProbability cores 1 2 4 8 16 32 Simulated Annealing local Estimated log-probabilities of the MAP configurations found by each algorithm 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 19
  • 32. Scalability: accuracy (Hill Climbing) −240 −220 −200 1 2 4 8 16 32 Number of cores logProbability cores 1 2 4 8 16 32 Hill Climbing global −240 −220 −200 1 2 4 8 16 32 Number of cores logProbability cores 1 2 4 8 16 32 Hill Climbing local Estimated log-probabilities of the MAP configurations found by each algorithm 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 20
  • 33. Outline 1 Motivation 2 MAP in CLG networks 3 Scalable MAP 4 Experimental results 5 Conclusions 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 21
  • 34. Conclusions Scalable MAP for CLG models in terms of accuracy and run time Available in the AMIDST Toolbox Valid for multi-cores and cluster systems MapReduce-based design on top of Apache Flink 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 22
  • 35. Thank you for your attention You can download our open source Java toolbox: http://www.amidsttoolbox.com Acknowledgments: This project has received funding from the European Union’s Seventh Framework Programme for research, technological development and demonstration under grant agreement no 619209 8th Int. Conf. on Probabilistic Graphical Models, Lugano, Sept. 6–9, 2016 23