SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Último

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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

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...
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
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
 

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