SlideShare una empresa de 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

Más contenido relacionado

Similar 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
 

Similar 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

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
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
 
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
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

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