SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Probabilistic Programming of
Non-Parametric Bayesian
Dynamic Discrete State Models
University of Southampton
Southampton, UK
14th Oct 2013

James McInerney
jem1c10@ecs.soton.ac.uk
Applications
Across domains:
– Exploration (visual summary of large amount of data;
answer “what if?” by modifying parameters)
– Inference (understand hidden structure of data; fill in
missing data)
– Prediction

2
Discrete State Models
– Each observation explained by a latent state
-e.g., GPS observation at (50.931157, -1.401897) explained by me
being at “home”

– Mixture model
-e.g., my next location is independent of previous locations

– Hidden Markov model
-e.g., my next location depends on previous location (first-order)

3
Non-parametric Bayes
What number of states to specify?
– Traditional solution: model selection/averaging
– Have to consider many different numbers of states: slow

4
Non-parametric Bayes
What number of states to specify?
– Traditional solution: model selection/averaging
– Have to consider many different numbers of states: slow
– More elegant: Dirichlet process (non-parametric Bayes)

5
Example Discrete State Models
Example problems potentially solvable with NP-HMMs:
- You have appliance usage data for a home, and want to
predict if and when appliances will be used the next day
- You have location data of teams in AtomicOrchid and want
to find team assignments based on proximity (dealing with
noise of GPS and ephemeral proximity)
- You have user activity on a website or application and want
to infer their state of mind and predict future actions
6
Probabilistic Programming
– Specify model using domain specific language
– Benefit: run inference of unknown model parameters with a
click of a button
– E.g., Infer.net, Church, Stan, Alchemy

7
Probabilistic Programming
Limitations (of Infer.net):
– Does not handle Dirichlet process models (non-parametric
Bayes for discrete states)
– Very limited handling of HMMs

8
My Limited, Small Scale Answer
– Probabilistic programming for non-parametric discrete state
models (HMMs, mixture models) in Python
– User can specify any number of sensors on data:
- Multivariate Gaussian sensor (any # dimensions)
- Discrete sensor
- von Mises (periodic data)
- mixture of Gaussians
– Implemented using variational approximation (= fast)
9
Define Your Own Sensor
Implement two methods:

class Sensor(object):
def __init__(self,K,hyperparams):
self._K = K #truncation parameter
self._hyperparams = hyperparams
def loglik(self,X):
#given data set X, provide the likelihood
#of each (N) data point.
#returns: (N,K) matrix, with unnormalised
#log liklihood for each component and each data point
def m(self,X,exp_z):
#given expected value of z, calculate the
#variational parameters of each component (w.r.t. this sensor)

10
Live Demo
4 lines of code to run inference on a custom, multi-modal,
non-parametric HMM:
K = <truncation parameter>
gSensor = sensors.MVGaussianSensor(K,XDim)
dSensor = sensors.DiscreteSensor(K)
exp_z,_,exp_a,Zmax = general_inf.infer(N,[X,Y],K,[gSensor,dSensor])

11
Download
git clone https://github.com/jamesmcinerney/np-hmm.git
(alpha version)

12

Weitere ähnliche Inhalte

Ähnlich wie Implementation of Variational Inference for Non-Parametric Hidden Markov Models

Seminar_New -CESG
Seminar_New -CESGSeminar_New -CESG
Seminar_New -CESG
Qian Wang
 
ProbabilisticModeling20080411
ProbabilisticModeling20080411ProbabilisticModeling20080411
ProbabilisticModeling20080411
Clay Stanek
 
Hadoop scalability
Hadoop scalabilityHadoop scalability
Hadoop scalability
WANdisco Plc
 
Deep Recurrent Neural Networks for Sequence Learning in Spark by Yves Mabiala
Deep Recurrent Neural Networks for Sequence Learning in Spark by Yves MabialaDeep Recurrent Neural Networks for Sequence Learning in Spark by Yves Mabiala
Deep Recurrent Neural Networks for Sequence Learning in Spark by Yves Mabiala
Spark Summit
 
Machine Learning: Foundations Course Number 0368403401
Machine Learning: Foundations Course Number 0368403401Machine Learning: Foundations Course Number 0368403401
Machine Learning: Foundations Course Number 0368403401
butest
 

Ähnlich wie Implementation of Variational Inference for Non-Parametric Hidden Markov Models (20)

Es1
Es1Es1
Es1
 
A survey on deep learning based approaches for action and gesture recognition...
A survey on deep learning based approaches for action and gesture recognition...A survey on deep learning based approaches for action and gesture recognition...
A survey on deep learning based approaches for action and gesture recognition...
 
Seminar_New -CESG
Seminar_New -CESGSeminar_New -CESG
Seminar_New -CESG
 
Deep Learning and Tensorflow Implementation(딥러닝, 텐서플로우, 파이썬, CNN)_Myungyon Ki...
Deep Learning and Tensorflow Implementation(딥러닝, 텐서플로우, 파이썬, CNN)_Myungyon Ki...Deep Learning and Tensorflow Implementation(딥러닝, 텐서플로우, 파이썬, CNN)_Myungyon Ki...
Deep Learning and Tensorflow Implementation(딥러닝, 텐서플로우, 파이썬, CNN)_Myungyon Ki...
 
Principles of Hierarchical Temporal Memory - Foundations of Machine Intelligence
Principles of Hierarchical Temporal Memory - Foundations of Machine IntelligencePrinciples of Hierarchical Temporal Memory - Foundations of Machine Intelligence
Principles of Hierarchical Temporal Memory - Foundations of Machine Intelligence
 
Hyperoptimized Machine Learning and Deep Learning Methods For Geospatial and ...
Hyperoptimized Machine Learning and Deep Learning Methods For Geospatial and ...Hyperoptimized Machine Learning and Deep Learning Methods For Geospatial and ...
Hyperoptimized Machine Learning and Deep Learning Methods For Geospatial and ...
 
ProbabilisticModeling20080411
ProbabilisticModeling20080411ProbabilisticModeling20080411
ProbabilisticModeling20080411
 
Could A Model Of Predictive Voting Explain Many Long-Range Connections? by Su...
Could A Model Of Predictive Voting Explain Many Long-Range Connections? by Su...Could A Model Of Predictive Voting Explain Many Long-Range Connections? by Su...
Could A Model Of Predictive Voting Explain Many Long-Range Connections? by Su...
 
Expert systems from rk
Expert systems from rkExpert systems from rk
Expert systems from rk
 
A Fuzzy Approach For Multi-Domain Sentiment Analysis
A Fuzzy Approach For Multi-Domain Sentiment AnalysisA Fuzzy Approach For Multi-Domain Sentiment Analysis
A Fuzzy Approach For Multi-Domain Sentiment Analysis
 
Deep Learning and Watson Studio
Deep Learning and Watson StudioDeep Learning and Watson Studio
Deep Learning and Watson Studio
 
Split my monolith - Devoxx
Split my monolith - DevoxxSplit my monolith - Devoxx
Split my monolith - Devoxx
 
Measuring and Predicting Departures from Routine in Human Mobility by Dirk Go...
Measuring and Predicting Departures from Routine in Human Mobility by Dirk Go...Measuring and Predicting Departures from Routine in Human Mobility by Dirk Go...
Measuring and Predicting Departures from Routine in Human Mobility by Dirk Go...
 
Hadoop scalability
Hadoop scalabilityHadoop scalability
Hadoop scalability
 
Deep Recurrent Neural Networks for Sequence Learning in Spark by Yves Mabiala
Deep Recurrent Neural Networks for Sequence Learning in Spark by Yves MabialaDeep Recurrent Neural Networks for Sequence Learning in Spark by Yves Mabiala
Deep Recurrent Neural Networks for Sequence Learning in Spark by Yves Mabiala
 
Challenges on Distributed Machine Learning
Challenges on Distributed Machine LearningChallenges on Distributed Machine Learning
Challenges on Distributed Machine Learning
 
Machine Learning: Foundations Course Number 0368403401
Machine Learning: Foundations Course Number 0368403401Machine Learning: Foundations Course Number 0368403401
Machine Learning: Foundations Course Number 0368403401
 
Split my monolith - Workshop
Split my monolith - WorkshopSplit my monolith - Workshop
Split my monolith - Workshop
 
Machine Learning Comparative Analysis - Part 1
Machine Learning Comparative Analysis - Part 1Machine Learning Comparative Analysis - Part 1
Machine Learning Comparative Analysis - Part 1
 
Kaggle presentation
Kaggle presentationKaggle presentation
Kaggle presentation
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Implementation of Variational Inference for Non-Parametric Hidden Markov Models

  • 1. Probabilistic Programming of Non-Parametric Bayesian Dynamic Discrete State Models University of Southampton Southampton, UK 14th Oct 2013 James McInerney jem1c10@ecs.soton.ac.uk
  • 2. Applications Across domains: – Exploration (visual summary of large amount of data; answer “what if?” by modifying parameters) – Inference (understand hidden structure of data; fill in missing data) – Prediction 2
  • 3. Discrete State Models – Each observation explained by a latent state -e.g., GPS observation at (50.931157, -1.401897) explained by me being at “home” – Mixture model -e.g., my next location is independent of previous locations – Hidden Markov model -e.g., my next location depends on previous location (first-order) 3
  • 4. Non-parametric Bayes What number of states to specify? – Traditional solution: model selection/averaging – Have to consider many different numbers of states: slow 4
  • 5. Non-parametric Bayes What number of states to specify? – Traditional solution: model selection/averaging – Have to consider many different numbers of states: slow – More elegant: Dirichlet process (non-parametric Bayes) 5
  • 6. Example Discrete State Models Example problems potentially solvable with NP-HMMs: - You have appliance usage data for a home, and want to predict if and when appliances will be used the next day - You have location data of teams in AtomicOrchid and want to find team assignments based on proximity (dealing with noise of GPS and ephemeral proximity) - You have user activity on a website or application and want to infer their state of mind and predict future actions 6
  • 7. Probabilistic Programming – Specify model using domain specific language – Benefit: run inference of unknown model parameters with a click of a button – E.g., Infer.net, Church, Stan, Alchemy 7
  • 8. Probabilistic Programming Limitations (of Infer.net): – Does not handle Dirichlet process models (non-parametric Bayes for discrete states) – Very limited handling of HMMs 8
  • 9. My Limited, Small Scale Answer – Probabilistic programming for non-parametric discrete state models (HMMs, mixture models) in Python – User can specify any number of sensors on data: - Multivariate Gaussian sensor (any # dimensions) - Discrete sensor - von Mises (periodic data) - mixture of Gaussians – Implemented using variational approximation (= fast) 9
  • 10. Define Your Own Sensor Implement two methods: class Sensor(object): def __init__(self,K,hyperparams): self._K = K #truncation parameter self._hyperparams = hyperparams def loglik(self,X): #given data set X, provide the likelihood #of each (N) data point. #returns: (N,K) matrix, with unnormalised #log liklihood for each component and each data point def m(self,X,exp_z): #given expected value of z, calculate the #variational parameters of each component (w.r.t. this sensor) 10
  • 11. Live Demo 4 lines of code to run inference on a custom, multi-modal, non-parametric HMM: K = <truncation parameter> gSensor = sensors.MVGaussianSensor(K,XDim) dSensor = sensors.DiscreteSensor(K) exp_z,_,exp_a,Zmax = general_inf.infer(N,[X,Y],K,[gSensor,dSensor]) 11