SlideShare a Scribd company logo
1 of 32
Download to read offline
Data Science Cafe 第3回
ベイズ生成モデルと深層生成モデルについて
今日のTopic
2020/9/23
2Data Science Cafe 第3回
ベイズモデリングについて
様々なベイズ生成モデル
について
深層生成モデル
便利な道具である雰囲気をつかむ
ベイズというと怖い人が出てくるので怖い
どんなことができるのか?
どの様に推論の手法について
ベイズ生成モデルを深層学習化していく
メリットについて
ベイズ生成モデルについて
3Data Science Cafe 第3回
ベイズの定理
ベイズモデリングとは?
◼ データ解析手法の一つ
◼ データに対して確率モデルを立てることでデータから何
らかしらの情報を引き出す。
◼ 有名な右の写真はトーマス・ベイズとは別人の可能性が
あるらしい
2020/9/23
4Data Science Cafe 第3回
事前分布事後分布 尤度
事前分布と尤度が分かっている時,事後分布が計算できることも重要
今後必要な知識
2020/9/23
5Data Science Cafe 第3回
周辺化
条件付確率
◼ とはいえあまり今日はベイズの定理は関係なく下のことさえ知ってい
ればOK
ベイズモデリングの良いところ
2020/9/23
6Data Science Cafe 第3回
◼不確実性を伴った予測
◼課題に合わせた柔軟な解析
◼オーバーフィットの回避
➢誤差を最小化する様に学習する訳では無いので起こりにくい
識別モデルと生成モデル
◼生成モデルとは?
➢観測データを生成する確率分布を想定し、観測データからその確率
分布を推定する方法
2020/9/23
7Data Science Cafe 第3回
クラス分類問題
生成モデル(広義)
生成モデル(狭義)
識別モデル
同時分布
条件付き分布
識別関数: 𝑦を𝐶に写像する関数
データ パラメータ 説明変数
データ クラス
学習
学習
グラフィカルモデル
◼確率変数間の依存関係を示した概念図
2020/9/23
8Data Science Cafe 第3回
𝜃
𝑥 𝑛
𝑁
ノード:
確率変数を表現
観測データは色がつ
いていることが多い
エッジ:
確率変数間の関係
プレート:
省略するために使用
For 𝑖 = 1,2,3 ⋯ , 𝑛
𝜃
𝑥𝑖𝑧𝑖
𝜂
ベイス生成モデルについて
9Data Science Cafe 第3回
様々なモデルと推論手法たち
◼GMM
◼LDA
◼HMM
◼Gaussian Process
◼Dirichlet process
etc.
2020/9/23
10Data Science Cafe 第3回
◼ MCMC
◼ EMアルゴリズム
◼ 最尤推定
◼ 変分推論
◼ 深層学習(後で説明)
etc.
モデル 推論手法
目的に合わせて様々なモデルを使い分けたり,組み合わせることで様々な問題を
教師なしに解くことが可能になる.また推論手法を使い分けることで,高速にパ
ラメータを推論したり複雑なモデルも推論することが可能になる.
Gaussian Mixture Model (GMM)
2020/9/23
11Data Science Cafe 第3回
複数個のガウス分布からデータが生成されていると考える手法
1個のガウス分布から生成? 複数のガウス分布から生成?
point
データにあった生成過程を考えることが大切
また,データに適した生成過程を考えるとモデルの尤度も高くなる
Gaussian Mixture Model (GMM)
2020/9/23
12Data Science Cafe 第3回
𝛼𝜋𝑧 𝑑
𝑥 𝑑
𝜇 𝑘 Σ 𝑘
𝑚0, 𝐾0 𝑉0, 𝜈0
𝐷
𝑁
複数個のガウス分布からデータが生成されていると考える手法
𝑧 𝑑によって,どのガウス分布
からデータが生成されている
かを考える
どのカテゴリであるかを決め
る分布
Latent Dirichlet Allocation (LDA)
2020/9/23
13Data Science Cafe 第3回
𝛼 𝛽𝜙 𝑘𝑥𝑖𝜃 𝑧𝑖
◼ トピックモデル
➢ 文章などのデータに対してトピックを抽出するために用いる手法
➢ 同じ様な話題には同じ様な単語が出現しやすいはずであるという仮定
➢ 𝑥𝑖文章データをBag-of-Wordsしたものなど
どの出現確率から
生成されているか
𝑥𝑖
point
GMMではどのガウス分布から生成されているか?LDAではどの単語発生確率
からデータが生成されているかを考えているだけでほとんど同じである
Hidden Markov Models(HMM)
◼時系列データに対して用いる手法
➢GMMなどに遷移確率がついたもの
2020/9/23
14Data Science Cafe 第3回
𝛼𝜋
𝑧1
𝑥1
𝜇 𝑘 Σ 𝑘
𝑚0, 𝐾0 𝑉0, 𝜈0
𝑁
𝑧2
𝑥2
𝑧3
𝑥3
𝑧 𝑛
𝑥 𝑛
⋯
𝛾𝛽
𝛼𝜋𝑧 𝑑
𝑥 𝑑
𝜇 𝑘 Σ 𝑘
𝑚0, 𝐾0 𝑉0, 𝜈0
𝐷
𝑁
point
LDAなどを様々なモデルを簡単に時系列データに適応できる. 𝜋がプレートに
乗っている理由はそれぞれのクラスからの遷移確率があるため
Gaussian Process
◼回帰分析を行う機械学習手法の1つであり予測信頼性を評価
することが可能
➢自由度の高いモデルであり,Black-Box Optimizationなど
で用いることができる.
➢無限次元のガウス分布と捉えることができる.
2020/9/23
15Data Science Cafe 第3回
K K∗
K∗
T K∗∗
𝑥
𝑥
𝑥∗
𝑥∗
学習データ
新しく得られたデータ 𝑥∗
カーネル関数を
使って右を計算
Dirichlet process
2020/9/23
16Data Science Cafe 第3回
GMMやLDAといった手法はあらかじめガウス分布の混合数やトピックの数を与え
る必要がある.これを解決するために無限個の混合数があることを考える.
これらを実装するにあたって有名なものにChinese restaurant processとStick-breaking
processがある.
𝛼𝜋𝑧 𝑑
𝑥 𝑑
𝜇 𝑘 Σ 𝑘
𝑚0, 𝐾0 𝑉0, 𝜈0
𝐷
𝑁
この分布が無限次元になる
と良い
Dirichlet process
2020/9/23
17Data Science Cafe 第3回
Chinese restaurant process Stick-breaking process
GMMやLDAといった手法はあらかじめガウス分布の混合数やトピックの数を与え
る必要がある.これを解決するために無限個の混合数があることを考える.
これらを実装するにあたって有名なものにChinese restaurant processとStick-breaking
processがある.
無限次元の離散分布を構成せず変
数を積分消去することで計算
無限次元の離散分布を構成する+
計算方法で工夫する
Dirichlet process
2020/9/23
18Data Science Cafe 第3回
Stick-breaking process
GMMやLDAといった手法はあらかじめガウス分布の混合数やトピックの数を与え
る必要がある.これを解決するために無限個の混合数があることを考える.
これらを実装するにあたって有名なものにChinese restaurant processとStick-breaking
processがある.
無限次元の離散分布を構成する+
計算方法で工夫する
GMMで言えばデータの個数以上のク
ラスはあり得ない.つまり十分大きな
値で計算を打ち切っても近似できる
→ weak limit approximation
深層生成モデルについて
19Data Science Cafe 第3回
Variational Autoencoders (VAE)
◼VAE
➢下記の様なグラフィカルモデルを深層学習を用いて推論する手法
➢深層学習の圧倒的な表現力を用いたモデルを構築することができる
2020/9/23
20Data Science Cafe 第3回
𝑧𝑡
𝑥𝑡 𝜃
𝜙
point
生成モデルを深層学習を用いて推論することができる.
ELBOの最大化
◼VAE
➢深層学習の圧倒的な表現力を用いたモデルを構築することができる
Variational Autoencoders (VAE)
2020/9/23
21Data Science Cafe 第3回
モンテカルロ近似
バックプロパーゲーション
できない
Reparameterization Trick 標準化
平均が0,分散が1になるようにデータ
を加工する処理
Gaussian Mixture Model (GMM)
2020/9/23
22Data Science Cafe 第3回
◼GMM深層学習と組み合わせた手法は様々な手法がある.
これらの手法はGMMの欠点であるガウス分布の楕円形の
クラスしか生成できない問題を解決することができる.
➢Structured Variational Autoencoder(SVAE)
➢Variational Deep Embedding(VaDE)
➢Gaussian Mixture Variational Autoencoder
ここを混合ガウス分布にする
Gaussian Mixture Model (GMM)
2020/9/23
23Data Science Cafe 第3回
◼GMM深層学習と組み合わせた手法は様々な手法がある.
これらの手法はGMMの欠点であるガウス分布の楕円形の
クラスしか生成できない問題を解決することができる.
➢Structured Variational Autoencoder(SVAE)
➢Variational Deep Embedding(VaDE)
➢Gaussian Mixture Variational Autoencoder
𝑧 𝑥 𝑦NN
Latent Dirichlet Allocation (LDA)
2020/9/23
24Data Science Cafe 第3回
𝜇 𝑘 = log 𝛼 𝑘 −
1
𝐾
෍
𝑖=𝑖
𝐾
log(𝛼𝑖)
Σ 𝑘,𝑘 =
1
𝛼 𝑘
1 −
2
𝐾
+
1
𝐾2
෍
𝑖=1
𝐾
1
𝛼 𝑘
𝛼 𝛽𝜙 𝑘𝑥𝑖𝜃 𝑧𝑖
LDAの𝜃: Dirichlet 分布がLocation-scale family でないためReparameterizationが困難
→Laplace approximationを利用する
正規分布からのサンプリングにSoftmax関数を適用して近似する
事前分布のパラメータは下記のとおりである
◼ ニューラルトピックモデル
➢ 深層生成モデルの一つであるVariational AutoEncoders (VAE) を用いてトピックモデル
を推論
Latent Dirichlet Allocation (LDA)
2020/9/23
25Data Science Cafe 第3回
𝛼 𝛽𝜙 𝑘𝑥𝑖𝜃 𝑧𝑖
◼ ニューラルトピックモデル
➢ 深層生成モデルの一つであるVariational AutoEncoders (VAE) を用いてトピックモデル
を推論
https://aws.amazon.com/jp/blogs/machine-learning/introduction-to-the-amazon-sagemaker-neural-topic-model/
Hidden Markov Models(HMM)
2020/9/23
26Data Science Cafe 第3回
◼Deep Markov Model
➢Structured Inference Networks for Nonlinear State Space Models
➢https://pyro.ai/examples/dmm.html
◼Deep Kalman Filters
➢Deep Kalman Filters
Gaussian Process
◼深層学習を用いてGaussian Processを近似する下記の様な手
法が存在する
➢Conditional Neural Process
➢Neural Process
➢Attentive Neural Process
➢Convolutional Conditional Neural Process
etc.
2020/9/23
27Data Science Cafe 第3回
Gaussian Process
◼深層学習を用いてGaussian Processを近似する下記の様な手
法が存在する
2020/9/23
28Data Science Cafe 第3回
point
ANP NP CNP
GPに比べると外挿に弱く,滑らかなデータを予測することが苦手なことが知ら
れている.
Dirichlet process
2020/9/23
29Data Science Cafe 第3回
◼The Recurrent Stick Breaking Construction
➢Discovering Discrete Latent Topics with Neural Variational Inferenceにて
提案された手法
➢Here we consider the stick breaking construction as a sequential draw from
an RNN, thus capturing an unbounded number of breaks with a finite
number of parameters
深層学習で推論することで嬉しいこと
◼共役事前分布を考慮しなくても変分推論を用いることができる
➢ Student-t分布などは指数分布族で無いので変分推論するのが大変
2020/9/23
30Data Science Cafe 第3回
𝑧
𝜇(𝑧)
𝜎2
(𝑧)
𝑥 𝑧 𝑥
𝜇(𝑧)
𝜈(𝑧)
𝜆(𝑧)
デコーダがガウス分布 デコーダがStudent-t分布
まとめ
ベイズ生成モデル 深層生成モデル
GMM
Structured Variational Autoencoder(SVAE)[1]
Variational Deep Embedding(VaDE)[2]
Gaussian Mixture Variational Autoencoder[3]
LDA Neural Topic model[4,5]
HMM
Deep Markov Model[6,7]
Deep Kalman Filters[8]
Dirichlet process Recurrent Stick Breaking Construction[9]
Gaussian Process
Conditional Neural Process[10]
Neural Process[11]
Attentive Neural Process[12]
Convolutional Conditional Neural Process[13]
2020/9/23
31Data Science Cafe 第3回
◼ ベイズモデルはとても使える
◼ ベイズ生成モデルには状況に応じて様々な手法がある
◼ 深層生成モデルを用いることでベイズ生成モデルの良さと深層学習の
良さを掛け合わせた解析をすることができる様になる
参考文献
◼ [1] Johnson, Matthew J., et al. "Structured VAEs: Composing probabilistic graphical models and
variational autoencoders." arXiv preprint arXiv:1603.06277 2 (2016): 2016.
◼ [2] Jiang, Zhuxi, et al. "Variational deep embedding: An unsupervised and generative approach to
clustering." arXiv preprint arXiv:1611.05148 (2016).
◼ [3] Dilokthanakul, Nat, et al. "Deep unsupervised clustering with gaussian mixture variational
autoencoders." arXiv preprint arXiv:1611.02648 (2016).
◼ [4] Cao, Ziqiang, et al. "A novel neural topic model and its supervised extension." Twenty-Ninth AAAI
Conference on Artificial Intelligence. 2015.
◼ [5] https://aws.amazon.com/jp/blogs/news/introduction-to-the-amazon-sagemaker-neural-topic-model/
◼ [6] Krishnan, Rahul G., Uri Shalit, and David Sontag. "Structured inference networks for nonlinear state
space models." arXiv preprint arXiv:1609.09869 (2016).
◼ [7] https://pyro.ai/examples/dmm.html
◼ [8] Krishnan, Rahul G., Uri Shalit, and David Sontag. "Deep kalman filters." arXiv preprint
arXiv:1511.05121 (2015).
◼ [9] Miao, Yishu, Edward Grefenstette, and Phil Blunsom. "Discovering discrete latent topics with neural
variational inference." arXiv preprint arXiv:1706.00359 (2017).
◼ [10] Garnelo, Marta, et al. "Conditional neural processes." arXiv preprint arXiv:1807.01613 (2018).
◼ [11] Garnelo, Marta, et al. "Neural processes." arXiv preprint arXiv:1807.01622 (2018).
◼ [12] Kim, Hyunjik, et al. "Attentive neural processes." arXiv preprint arXiv:1901.05761 (2019).
◼ [13] Gordon, Jonathan, et al. "Convolutional conditional neural processes." arXiv preprint
arXiv:1910.13556 (2019).
2020/9/23
32Data Science Cafe 第3回

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

ベイズと深層学習について