ishihata 150319-final

79
Copyright©2014 NTT corp. All Rights Reserved. 離散分布と離散構造 NTT コミュニケーション科学基礎研究所 石畠正和 数学協働プログラム 確率的グラフィカルモデル 2015319()-20() @ 電気通信大学

Upload: masakazu-ishihata

Post on 14-Jul-2015

306 views

Category:

Science


0 download

TRANSCRIPT

Copyright©2014 NTT corp. All Rights Reserved.

離散分布と離散構造

NTT コミュニケーション科学基礎研究所

石畠正和

数学協働プログラム 確率的グラフィカルモデル 2015年3月19(木)-20(金) @ 電気通信大学

2 Copyright©2014 NTT corp. All Rights Reserved.

石畠正和 (いしはた まさかず)

経歴

2006 石川高専 修了

2008-2014 東工大 (学士, 修士, 博士) 修了

2013 NTT CS 研 入社

指導教官

佐藤泰介 教授 (東工大)

研究内容

論理に基づく確率モデリング

博士論文

Propositionalized Probability Computation and Learning on Binary Decision Diagrams

北陸新幹線 - Wikipedia http://ja.wikipedia.org/wiki/%E5%8C%97%E9%99%B8%E6%96%B0%E5%B9%B9%E7%B7%9A

3 Copyright©2014 NTT corp. All Rights Reserved.

発表の流れ

1. 確率モデリングとは

2. 確率と論理

3. 離散分布と離散構造

4 Copyright©2014 NTT corp. All Rights Reserved.

確率モデリングとは

• 確率モデリング

• 興味のある対象を 確率モデル で記述すること

• 確率モデル = 確率分布

• 同時確率分布

• 条件付き確率分布

• 用途

• 予測 / 分類 / 診断

• 期待値計算

• 確率変数間の関係を理解

5 Copyright©2014 NTT corp. All Rights Reserved.

有名な確率モデル

• Naïve Bayes Model (NBM)

• 分類、診断、クラスタリング

• Hidden Markov Model (HMM)

• 系列データ解析

• Latent Dirichlet Allocation (LDA)

• 文書中の単語のトピック解析

y

x1 x2 xN

z1

x1 x2 xN

z2 zN

...

...

...

zdi xdi θd

φk β α

6 Copyright©2014 NTT corp. All Rights Reserved.

確率的グラフィカルモデル

• グラフで表現された確率モデル

• Bayesian Network (BN) : 有向

• Markov Random Field (MRF) : 無向

• 条件付き独立性を定義

• 素敵なところ

• 一目で分かった気になれる

y

x1 x2 xN

z1

x1 x2 xN

z2 zN

...

...

...

zdi xdi θd

φk β α

7 Copyright©2014 NTT corp. All Rights Reserved.

Bayesian Network (BN)

Bayesian network - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Bayesian_network

8 Copyright©2014 NTT corp. All Rights Reserved.

Bayesian Network (BN)

Bayesian network - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Bayesian_network

Directed Acyclic Graph (DAG)

Conditional Probability Table (CPT)

同時分布を定義

9 Copyright©2014 NTT corp. All Rights Reserved.

Bayesian Network (BN)

Bayesian Network (BN)

確率変数集合の 同時分布 を定義

Directed Acyclic Graph (DAG)

確率変数間の 条件付き独立性 を定義

Conditional Probability Table (CPT)

各確率変数の 条件付き確率分布 を定義

p(A, B, C)

p(A, B, C) =

p(A) p(B | A) p(C | A)

p(B=0 | A=1) = 0.3

p(B=1 | A=1) = 0.7

A

B C

10 Copyright©2014 NTT corp. All Rights Reserved.

確率モデルを設計する

• モデルの設計

• モデルの 複雑さ と 表現力 のトレードオフを コントロール

• モデルの複雑さ = 計算量

• 何も仮定しない 指数的な計算量

• 独立性を仮定する 計算量を削減

• モデルの表現力 = 精度

• 何も仮定しない ありとあらゆる分布を表現可能

• 独立性を仮定する 表現力が下がる

独立性を仮定

11 Copyright©2014 NTT corp. All Rights Reserved.

確率モデルを設計する

• どうやって独立性を記述する?

• グラフで表現する (= 確率的グラフィカルモデル)

• 独立性の調整 = グラフ構造の調整

• グラフの記述力は十分?

• 不十分!

• 細かな独立性を記述するには 論理 が適役!

• 独立性の調整 = 論理式の書き換え

12 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

• あなたは 問診票 から 病気A の検診を受け

るべきかの識別器を作る依頼を受けました

• 問診票 と 回答者の病気Aの有無 の教師

データが与えられました

• あなたはとりあえず Naïve Bayes Model で

データを学習しました

13 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

A

Q1 Q4 Q2 Q3

Q5

p(A, Q1,…,Q5) = p(A) Πi p(Qi | A)

A が与えられた元では Q1~Q5 は独立

14 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

• 精度はもう一声…

• モデル を医者に見せてアドバイスを仰ぎました

• 「問診票で Yes が 3 個以上なら検診してます」

• ルール 単体の精度ももう一声…

• ルール と モデル を組合せて精度向上できる?

15 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

A

Q1 Q4 Q2 Q3

Q5

仮定) A = True なら Yes が 3 個以上

A が与えられた元では Q1~Q5 は独立

16 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

A

Q1 Q4 Q2 Q3

Q5

= True

||

No

||

No

仮定) A = True なら Yes が 3 個以上

17 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

A

Q1 Q4 Q2 Q3

Q5

= True

||

No

||

No

||

Yes

||

Yes

||

Yes

A が与えられた時 Q1~Q5 が独立でない!!

仮定) A = True なら Yes が 3 個以上

18 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

A

Q1 Q4 Q2 Q3

Q5

= True

||

No

||

No

||

Yes

||

Yes

||

Yes

A が与えられた時 Q1~Q5 が独立でない!!

仮定) A = True なら Yes が 3 個以上

19 Copyright©2014 NTT corp. All Rights Reserved.

細かい独立性なんて必要?

• 条件付き独立性 だけでは表現力不足

• もっと細かな独立性が必要

1. Independence

2. Conditional Independence

3. Context Specific Independence

4. Partial Exchangeability 弱い仮定

強い仮定

20 Copyright©2014 NTT corp. All Rights Reserved.

発表の流れ

1. 確率モデリングとは

2. 確率と論理

1. 離散同時分布

2. 条件付き確率

3. 独立性と論理

3. 離散分布と離散構造

21 Copyright©2014 NTT corp. All Rights Reserved.

離散確率変数

離散確率変数 X

• 離散の値を取る確率変数

• 本発表では 有限の値 とする

Bernoulli 分布 (= 2値 / コイン)

• p(X=x | θ) = θx (1-θ)1-x,

• x∈{0,1}, θ ∈[0,1]

Categorical 分布 (= 多値 / サイコロ)

• p(X=x | θ) = Πi θi[x=i] = θx

• x∈{1,...,M}, θ=(θ1,...,θM), θi∈[0,1], ∑i θi = 1

p( X = 表(1) ) = θ

p( X = 裏(0) ) =1-θ

p(X = 1) = θ1

p(X = 2) = θ2

...

p(X = 6) = θ6

(∑i=1...6 θi = 1)

22 Copyright©2014 NTT corp. All Rights Reserved.

ID x1 x2 x3 p(x)

1 0 0 0 θ1

2 0 0 1 θ2

3 0 1 0 θ3

4 0 1 1 θ4

5 1 0 0 θ5

6 1 0 1 θ6

7 1 1 0 θ7

8 1 1 1 θ8

離散確率変数の同時分布 p(X | θ)

• Xi = 離散確率変数, xi∈{0,1}

• X = (X1,...,XN), x ∈Ω ≡{0, 1}N

• p(X = x | θ) = θID(x)

• θ=(θ1,...,θM), M = 2N

任意の同時分布を定めるには指数個のパラメータが必要

X の確率表

離散同時分布

23 Copyright©2014 NTT corp. All Rights Reserved.

条件付き確率

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342

X1 の CPT

ID x1=0 1

1 θ111 θ112

X2 の CPT

X3 の CPT

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3)

X1

X2 X3

p(X | θ) の DAG

24 Copyright©2014 NTT corp. All Rights Reserved.

条件付き確率

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342 θijk ≡ 表 i の行 j の列 k のパラメータ

= p(Xi = xik | ID(x1:i-1) = j, θi) xik ≡ Xi の k 番目の値

x1:i ≡ (x1,...,xi)

X1 の CPT

X2 の CPT

X3 の CPT

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3) 3

2

1

25 Copyright©2014 NTT corp. All Rights Reserved.

条件付き確率

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342

p(X1=1, X2=1, X3=1, θ) = θ112 θ222 θ342

θijk ≡ 表 i の行 j の列 k のパラメータ

= p(Xi = xik | ID(x1:i-1) = j, θi)

X1 の CPT

X2 の CPT

X3 の CPT

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3)

26 Copyright©2014 NTT corp. All Rights Reserved.

条件付き確率

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342

X1 の CPT

X2 の CPT

X3 の CPT

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3)

p(X1=1, X2=1, X3=1, θ) = θ112 θ222 θ342

θijk ≡ 表 i の行 j の列 k のパラメータ

= p(Xi = xik | ID(x1:i-1) = j, θi)

27 Copyright©2014 NTT corp. All Rights Reserved.

条件付き確率

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342

X1 の CPT

X2 の CPT

X3 の CPT

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3)

p(X1=1, X2=1, X3=1, θ) = θ112 θ222 θ342

θijk ≡ 表 i の行 j の列 k のパラメータ

= p(Xi = xik | ID(x1:i-1) = j, θi)

28 Copyright©2014 NTT corp. All Rights Reserved.

条件付き確率

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342

X1 の CPT

X2 の CPT

X3 の CPT

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3)

p(X1=1, X2=1, X3=1, θ) = θ112 θ222 θ342

θijk ≡ 表 i の行 j の列 k のパラメータ

= p(Xi = xik | ID(x1:i-1) = j, θi)

29 Copyright©2014 NTT corp. All Rights Reserved.

条件付き確率

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342

ただ条件付き確率に分解してもパラメータは指数個

各行が Categorical 分布

X1 の CPT

X2 の CPT

X3 の CPT

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3)

30 Copyright©2014 NTT corp. All Rights Reserved.

p(X | θ) を効率的に定義する唯一の方法

ID x1 x2 ... xi-1 xi=0 1

1 0 0 ... 0 θi11 θi12

2 0 0 ... 1 θi21 θi22

... ... ... ... ... ... ...

... ... ... ... ... ... ...

... ... ... ... ... ... ...

2i-1-1 1 1 ... 0 ... ...

2i-1 1 1 ... 1 θi2i-11 θi2i-12

Xi の CPT = 指数サイズ

p(Xi | X1,...,Xi-1, θ)

p(Xi=xik| ID(x1:i-1)= j, θi) ≡ θijk

31 Copyright©2014 NTT corp. All Rights Reserved.

ID x1 x2 ... xi-1 xi=0 1

1 0 0 ... 0 θi11 θi12

2 0 0 ... 1 θi21 θi22

... ... ... ... ... ... ...

... ... ... ... ... ... ...

... ... ... ... ... ... ...

2i-1-1 1 1 ... 0 ... ...

2i-1 1 1 ... 1 θi2i-11 θi2i-12

ID xi=0 1

1 θi11 θi12

2 θi21 θi22

... ... ...

Mi θiMi1 θiMi2

パラメータを共有する

???

Xi のコンパクトな CPT Mi = 多項式サイズ

写像 Ti

Xi の CPT = 指数サイズ

p(Xi | X1,...,Xi-1, θ) p(Xi | X1,...,Xi-1, θ)

p(X | θ) を効率的に定義する唯一の方法

32 Copyright©2014 NTT corp. All Rights Reserved.

パラメータを共有する

ID Ti(x1:i-1) xi=0 1

1 1 θi11 θi12

2 2 θi21 θi22

... ... ... ...

Mi Mi θiMi1 θiMi2

Parameter Tying (Sharing)

Ti : {0,1}i-1 → {1,...,Mi}

p(Xi=xik | Ti(x1:i-1) = j, θi) ≡ θijk

x1:i-1 = (x1, x2,..., xi-1)

x1:i-1 ∈{0,1}i-1

Xi のコンパクトな CPT

p(Xi | X1,...,Xi-1, θ)

p(X | θ) を効率的に定義する唯一の方法

x1:i-1の代わりに Ti(x1:i-1) の値で

対応するパラメータを定義

33 Copyright©2014 NTT corp. All Rights Reserved.

パラメータを共有する

ID Ti(x1:i-1) xi=0 1

1 1 θi11 θi12

2 2 θi21 θi22

... ... ... ...

Mi Mi θiMi1 θiMi2

Parameter Tying (Sharing)

Ti : {0,1}i-1 → {1,...,Mi}

p(Xi=xik | Ti(x1:i-1) = j, θi) ≡ θijk

Xi のコンパクトな CPT

p(Xi | X1,...,Xi-1, θ)

Ti を定義する

= 独立性を仮定する

p(X | θ) を効率的に定義する唯一の方法

x1:i-1 = (x1, x2,..., xi-1)

x1:i-1 ∈{0,1}i-1

34 Copyright©2014 NTT corp. All Rights Reserved.

離散分布と独立性

1. Independence

2. Conditional Independence

3. Context Specific Independence [Boutilier+ 96]

4. Partial Exchangeability [Niepert+ 14a]

強い独立性

弱い独立性

35 Copyright©2014 NTT corp. All Rights Reserved.

離散分布と独立性

1. Independence

2. Conditional Independence

3. Context Specific Independence [Boutilier+ 96]

4. Partial Exchangeability [Niepert+ 14a]

Bayesian Network

強い独立性

弱い独立性

36 Copyright©2014 NTT corp. All Rights Reserved.

離散分布と独立性

1. Independence

2. Conditional Independence

3. Context Specific Independence [Boutilier+ 96]

4. Partial Exchangeability [Niepert+ 14a]

論理

強い独立性

弱い独立性

37 Copyright©2014 NTT corp. All Rights Reserved.

0. 独立性なし

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | X1, θ2)p(X3 | X1, X2, θ3)

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ341 θ342

X1

X2 X3

すべての条件列が異なるパラメータを持つ (指数個)

38 Copyright©2014 NTT corp. All Rights Reserved.

1. Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ211 θ212

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ311 θ312

3 1 0 θ311 θ312

4 1 1 θ311 θ312

独立性 = すべての条件列を無視する

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | θ2)p(X3 | θ3) : X1⊥⊥X2 ⊥⊥X3

39 Copyright©2014 NTT corp. All Rights Reserved.

1. Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 * θ211 θ212

ID x1 x2 x3=0 1

1 * * θ311 θ312

独立性 = すべての条件列を無視する

T2(x1) = 1

T3(x1, x2) = 1

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | θ2)p(X3 | θ3) : X1⊥⊥X2 ⊥⊥X3

40 Copyright©2014 NTT corp. All Rights Reserved.

1. Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 * θ211 θ212

ID x1 x2 x3=0 1

1 * * θ311 θ312

独立性 = すべての条件列を無視する

p(X1, X2, X3 | θ) = p(X1 | θ1)p(X2 | θ2)p(X3 | θ3) : X1⊥⊥X2 ⊥⊥X3

X1

X2 X3

41 Copyright©2014 NTT corp. All Rights Reserved.

2. Conditional Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ311 θ312

3 1 0 θ321 θ322

4 1 1 θ321 θ322

条件付き独立性 = 特定の条件列を無視する

p(X3 | X1, X2, θ3) = p(X3 | X1, θ3) : X2⊥⊥X3 | X1

42 Copyright©2014 NTT corp. All Rights Reserved.

2. Conditional Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 * θ311 θ312

2 1 * θ321 θ322

条件付き独立性 = 特定の条件列を無視する

T3(x1, x2) = 1 : x1 = 0

2 : x1 = 1

p(X3 | X1, X2, θ3) = p(X3 | X1, θ3) : X2⊥⊥X3 | X1

43 Copyright©2014 NTT corp. All Rights Reserved.

2. Conditional Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 * θ311 θ312

2 1 * θ321 θ322

条件付き独立性 = 特定の条件列を無視する

p(X3 | X1, X2, θ3) = p(X3 | X1, θ3) : X2⊥⊥X3 | X1

X1

X2 X3

44 Copyright©2014 NTT corp. All Rights Reserved.

3. Context Specific Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ331 θ332

4 1 1 θ331 θ332

文脈依存独立性 = 特定の条件下で特定の条件列を無視する

p(X3 | X1=1, X2, θ3) = p(X3 | X1=1, θ3) : X2⊥⊥X3 | X1=1

45 Copyright©2014 NTT corp. All Rights Reserved.

3. Context Specific Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 * θ331 θ332

文脈依存独立性 = 特定の条件下で特定の条件列を無視する

T3(x1, x2) =

1 : x1=0, x2=0

2 : x1=0, x2=1

3 : x1=1

p(X3 | X1=1, X2, θ3) = p(X3 | X1=1, θ3) : X2⊥⊥X3 | X1=1

46 Copyright©2014 NTT corp. All Rights Reserved.

3. Context Specific Independence

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 * θ331 θ332

文脈依存独立性 = 特定の条件下で特定の条件列を無視する

p(X3 | X1=1, X2, θ3) = p(X3 | X1=1, θ3) : X2⊥⊥X3 | X1=1

X1=0

X2 X3

X1=1

X2 X3 CSI は BN で表現できない

47 Copyright©2014 NTT corp. All Rights Reserved.

4. Partial Exchangeability

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ321 θ322

4 1 1 θ331 θ332

逆にこのように Parameter Tying するには

どうすればよいか?

p(X3 | X1, X2, θ3) = ???

48 Copyright©2014 NTT corp. All Rights Reserved.

4. Partial Exchangeability

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ321 θ322

4 1 1 θ331 θ332

T3(x1, x2) = ???

p(X3= x3k | X1=x1, X2=x2, θ3) = θ3 T3(x1,x2) k

49 Copyright©2014 NTT corp. All Rights Reserved.

4. Partial Exchangeability

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID T3(x1,x2) x3=0 1

1 1 θ311 θ312

2 2 θ321 θ322

3 3 θ331 θ332

T3(x1, x2) =

部分交換可能性 = 特定の条件 T でパラメータを共有

p(X3= x3k | X1=x1, X2=x2, θ3) = θ3 T3(x1,x2) k

1 : x1 = x2= 0

2 : x1 ≠ x2

3 : x1 = x2 =1

50 Copyright©2014 NTT corp. All Rights Reserved.

4. Partial Exchangeability

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID T3(x1,x2) x3=0 1

1 1 θ311 θ312

2 2 θ321 θ322

3 3 θ331 θ332

部分交換可能性 = 特定の条件 T でパラメータを共有

p(X3= x3k | X1=x1, X2=x2, θ3) = θ3 T3(x1,x2) k

X1

X2 X3

BN ではこれ以上表現しようがない

51 Copyright©2014 NTT corp. All Rights Reserved.

論理と独立性

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ321 θ322

4 1 1 θ311 θ312

更に!このように Parameter Tying するには

どうすればよいか?

p(X3= x3k | X1=x1, X2=x2, θ3) = θ3 T3(x1,x2) k

52 Copyright©2014 NTT corp. All Rights Reserved.

論理と独立性

ID x1=0 1

1 θ111 θ112

ID x1 x2=0 1

1 0 θ211 θ212

2 1 θ221 θ222

ID x1 x2 x3=0 1

1 0 0 θ311 θ312

2 0 1 θ321 θ322

3 1 0 θ321 θ322

4 1 1 θ331 θ332

T3(x1, x2) =

1 : x1 ⊕ x2

2 : otherwise

あらゆる条件は論理で記述可能!!

p(X3= x3k | X1=x1, X2=x2, θ3) = θ3 T3(x1,x2) k

53 Copyright©2014 NTT corp. All Rights Reserved.

論理と独立性

論理を用いたパラメータ共有

Tij ≡ X1:i-1 上の論理式

Tij(x1:i-1) ≡ “Ti(xi:i-1) = j ”と等価な論理関数

ID x1 x2 x3=0 1 T31 T32

1 0 0 θ311 θ312 1 0

2 0 1 θ321 θ322 0 1

3 1 0 θ321 θ322 0 1

4 1 1 θ331 θ332 1 0

共有を直接論理式で 書き下せば良い

54 Copyright©2014 NTT corp. All Rights Reserved.

論理と独立性

• 確率表も同様に定義可能 ID x1 x2 x3 p(x)

1 0 0 0 θ1

2 0 0 1 θ2

3 0 1 0 θ3

4 0 1 1 θ4

5 1 0 0 θ5

6 1 0 1 θ6

7 1 1 0 θ7

8 1 1 1 θ8

X の確率表

p(X = x | θ) = θID(x)

55 Copyright©2014 NTT corp. All Rights Reserved.

論理と独立性

• 確率表も同様に定義可能 ID x1 x2 x3 p(x)

1 0 0 0 θ1

2 0 0 1 θ2

3 0 1 0

4 0 1 1 θ3

5 1 0 0 θ2

6 1 0 1 θ3

7 1 1 0

8 1 1 1 θ4

X の確率表

p(X = x | θ) = θID(x)

p(X = x | θ) = θT(x)

T(x) =

1 : sum(x) = 0

2 : sum(x) = 1

3 : sum(x) = 2

4 : sum(x) = 3

56 Copyright©2014 NTT corp. All Rights Reserved.

問診の例

ID Q1 Q2 Q3 Q4 Q5 p(Q | A)

1 No No No No No θ1

... … …

… … …

… … …

32 Yes Yes Yes Yes Yes θ32

A

Q1 Q4 Q2 Q3 Q5

仮定) A = True なら Yes が 3 個以上

57 Copyright©2014 NTT corp. All Rights Reserved.

問診の例

ID Q1 Q2 Q3 Q4 Q5 p(Q | A)

1 Yes の数 = 0 θ1

2 Yes の数 = 1 θ2

3 Yes の数 = 2 θ3

4 Yes の数 = 3 θ4

5 Yes の数 = 4 θ5

6 Yes の数 = 5 θ6

A

Q1 Q4 Q2 Q3 Q5

仮定) A = True なら Yes が 3 個以上

p(Q = q | A=True, θ) = θT(q)

T(q) = q 中の Yes の数

Low

High

58 Copyright©2014 NTT corp. All Rights Reserved.

論理と独立性

• 論理 を用いて細かな独立性を定義可能

• 論理 を用いることで ルール を考慮した柔軟

なモデリングが可能

59 Copyright©2014 NTT corp. All Rights Reserved.

発表の流れ

1. 確率モデリングとは

2. 確率と論理

3. 離散分布と離散構造

1. Compiling Probabilistic Models

2. 発想の転換

60 Copyright©2014 NTT corp. All Rights Reserved.

離散分布と離散構造

• 離散分布

• 離散確率変数の同時分布

• 実は 論理 を用いて独立性(= モデル)を記述可能

• 離散構造

• 論理、グラフなど + それらを 効率的に扱う仕組み

• 離散分布と離散構造

• 論理を効率的に扱えれば、離散分布も効率的に扱える

• すべての不幸を 論理 に押し付ける

61 Copyright©2014 NTT corp. All Rights Reserved.

Knowledge Compilation [Darwich 02]

タスクに応じて 論理 を適切な形式に変換

変換後の形式上で効率的にタスクを実行

タスクの例 Consistency Validity Implicant Equivalence Model Counting Model Enumeration ...

形式の例 Negation Normal Form (NNF) Decomposable NNF (DNNF) Deterministic NNF (d-NNF) d-DNNF Binary Decision Diagram (BDD) Disjunctive Normal Form (DNF)

Conjunctive Normal Form (CNF) ...

|| 変換後の形式サイズに対して多項式時間

X1

X3

X2

0 1

62 Copyright©2014 NTT corp. All Rights Reserved.

Compiling Probabilistic Models

1. 離散同時分布を論理式 Tij を用いて定義

2. 適切なデータ構造に Compile (圧縮)

3. データ構造上で Dynamic Programming を実行

X1

X3

X2

0 1

Model

Ti1 = (X1∨X2)∧X3

Ti2 = ¬Til ∧ X4

Ti3 = ¬(Ti1∨Ti2)

....

Observation

F = X1 ∨ X2

1. Modeling 2. Compiling 3. Dynamic Programming

X1

X3

X2

0 1

63 Copyright©2014 NTT corp. All Rights Reserved.

Compiling Probabilistic Models

• Compiling Bayesian Networks

• Probabilistic Logic Programming

• Lifted Inference

64 Copyright©2014 NTT corp. All Rights Reserved.

Compiling Bayesian Network

DAG + CPT を合わせて別の構造に Compile (圧縮)

変換後の構造上の DP で確率計算

→ Context Specific Independence を効率的に扱える

BDD に変換 [Ishihata+ 11a]

ZDD に変換 [Minato+ 07]

d-DNNF に変換 [Chavira+ 05, 07]

65 Copyright©2014 NTT corp. All Rights Reserved.

Probabilistic Logic Programming

Model (Language) Structure

PRISM [Sato+ 01] Explanation Graph / BDD

LPAD [Vennekens+ 04] BDD

Markov Logic [Richardson+06] d-DNNF

ProbLog [DeRaedt+07] BDD / d-DNNF EM algorithm on BDDs [Ishihata+ 08]

Variational Bayes on BDDs [Ishiahta+ 11b] MCMC-Bayes on BDDs [Ishihata+ 11c]

述語論理を利用して確率モデルを定義 [DeRaedt+ 08]

Statistical Relational Learning とも呼ばれる [Getoor+ 07]

推論、学習を行う処理系を含む

66 Copyright©2014 NTT corp. All Rights Reserved.

Lifted Inference

当初 : Lifted Inference [Poole 03]

述語論理を利用して効率的に確率を定義・計算する

述語 : Friend(X,Y), Smoke(X), X, Y ∈ D

ルール : Smoke(X) ∧ Friend(X,Y) ⇒ Smoke(Y)

ドメイン : D ≡ {Alice, Bob, Charlie, ...}

確率変数: Friend(Alice, Bob), Friend(Alice, Charlie), ...

現在 : Domain-lifted Inference [Broeck 11b]

確率推論が ドメインサイズ |D| の多項式時間 O(Poly(|D|))

変数の数 = O( Poly(|D|) )

通常の計算量 = O( 2Poly(|D|) )

“効率的” = 曖昧な定義

Lift!!

67 Copyright©2014 NTT corp. All Rights Reserved.

Lifted Inference の Trick

Partial Exchangeability in First-Order Logic

述語論理 = 1ルールで複数変数の関係を記述

→ 似た関係をもつ変数が大量に発生

→ Partial Exchangeability!!

First-Order Model Counting [Broeck 11]

述語論理の MC を 命題論理を経由せずに 計算

述語論理の対称性を利用することで効率化

68 Copyright©2014 NTT corp. All Rights Reserved.

Lifted Inference の Trick

First-Order d-DNNF [Broeck 11a]

d-DNNF を述語論理に拡張

Partial Exchangeability を非常に効率的に表現

→ O(2Poly(N)) を O(Poly(N)) に削減

FO d-DNNF は万能か?? No!!

モデルの持つ対称性に依存

強い対称性を仮定 [Broack+ 12]

(2項関係の観測があると #P-hard)

69 Copyright©2014 NTT corp. All Rights Reserved.

発想の転換

従来の考え

論理で独立性 (= 確率モデル) を記述

論理を別形式 (BDD, d-DNNF,...) に Compile (圧縮)

別形式がコンパクトなら効率的に計算可能

発想の転換

はじめからコンパクトな形式で確率モデルを定義

70 Copyright©2014 NTT corp. All Rights Reserved.

Sum Product Network

d-DNNF と似た構造を利用して p(x) を定義

• 厳密計算 [Poon+ 11] ← UAI Best Paper

• パラメータ学習 [Gens+ 12] ← NIPS Best Paper

• 構造学習 [Gens+ 13]

• ID-SPN [Rooshenas+ 14]

Sum Product Network Compiling BN to d-DNNF

71 Copyright©2014 NTT corp. All Rights Reserved.

Exchangeable Variable Model

Exchangeable Variable Model [Niepert+ 14b]

Exchangeable Component の混合分布

Naïve Bayes を Partial Exchangeability により一般化

単純な計算で SVM 並みの性能

Exchangeable Component

Partial Exchangeable が成り立つ変数集合 X の生成分布

T(X) の値 j を生成し、 T(x) = j なる x を一様に生成

72 Copyright©2014 NTT corp. All Rights Reserved.

Generating Graphical models [Ishihata+14]

• データは順序木で表現できる構造を持つと仮定

• 構造を元に 効率的に計算できる範囲で Graphical Model を自動生成

• 汎用学習アルゴリズムによりモデルが変わっても学習可能

文書データを表す順序木

73 Copyright©2014 NTT corp. All Rights Reserved.

まとめ : 論理と確率

~ 2010 年

離散分布は複雑

離散分布は 論理 を用いて効率的に定義可能

論理 は グラフ構造 を用いて効率的に計算可能

2010年~

最も効率的に計算できるのはどのようなときか? = Lifted Inference

離散分布を直接効率的に計算できるグラフで定義

人工知能ブーム

Deep Learning に便乗

論理(やグラフ)という古き良き AI の技を ML 業界で流行らせたい (という意図が見られる)

Copyright©2014 NTT corp. All Rights Reserved.

Reference

75 Copyright©2014 NTT corp. All Rights Reserved.

Bayesian Networks

[Pearl 85] Judea Pearl: “Bayesian Networks: A Model of Self-Activated Memory for Evidential Reasoning”,

CogSci85

[Pearl 82] Judea Pearl: “Reverend Bayes on inference engines: A distributed hierarchical approach”,

AAAI Press

[Kim+ 83] Jin H Kim, Judea Pearl: “A computational model for combined causal and diagnostic reasoning

in inference systems”, IJCAI83

[Pearl 88] Judea Pearl: “Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference”

[Lauritzen88] Lauritzen, S.L. and Spiegelhalter, D.: “local computations with probabilities on graphical

structures and their application to expert systems”, JRSS88

[Boutilier+ 96] C. Boutilier, N. Friedman, M. Goldszmidt, and D. Koller: “Context-Specific Independence

in Bayesian Networks”, UAI96

76 Copyright©2014 NTT corp. All Rights Reserved.

Compiling Bayesian Networks

[Chavira+ 05] Mark Chavira, Adnan Darwiche: “Compiling Bayesian

Networks with Local Structure”, IJCAI05

[Minato+ 07] S. Minato, K. Satoh, and T. Sato: “Compiling Bayesian

Networks by Symbolic Probability Calculation Based on Zero-

suppressed BDDs”, IJCAI07

[Chavira+ 07] “Compiling Bayesian Networks Using Variable

Elimination ”, IJCAI07

[Ishihata+ 11] M. Ishihata, T. Sato and S. Minato: "Compiling Bayesian

Networks for Parameter Learning based on Shared BDDs“, AAI11

77 Copyright©2014 NTT corp. All Rights Reserved.

Probabilistic Logic Programming

[Getoor+ 07] Lise Getoor and Ben Taskar: “Introduction to Statistical Relational Learning”, MIT Press

[DeRaedt+ 08] L. DeRaedt and K. Kersting: “Probabilistic inductive logic programming”, Springer

[Sato+ 01] T. Sato and Y. Kameya: “Parameter learning of logic programs for symbolic-statistical

modeling”, JAIR

[Vennekens+ 04] Vennekens, J., Verbaeten, S., Bruynooghe, M.: “Logic programs with annotaqted

disjunctions”, ICLP04

[Richardson+ 06] M. Richardson and P. Domingos: “Markov logic networks”, Machine Learning

[DeRaedt+ 07] L. De Raedt, A. Kimming and H. Toivonen: “ProbLog: a probabilistic Prolog and its

application in link discovery”, IJCAI07

78 Copyright©2014 NTT corp. All Rights Reserved.

Lifted Inference

[Poole 03] David Poole “First-order probabilistic inference”, IJCAI03

[Broeck 11a] Guy Van den Broeck, Nima Taghipour, Wannes Meert, Jesse Davis and Luc De Raedt: “Lifted

Probabilistic Inference by First-Order Knowledge Comppilation”, IJCAI11

[Broeck 11b] Guy Van den Broeck: “On the completeness of first-order knowledge compilation for lifted

probabilistic inference”, NIPS11

[Broeck+ 12] Guy Van den Broeck and Adnan Darwiche: “On the complexity and approximation of binary

evidence in lifted inference”, NIPS12

[Niepert+ 14a] Mathias Niepert and Guy Van den Broeck: “Tractability through Exchangeability: A New

Perspective on Efficient Probabilistic Inference”, AAAI’14

79 Copyright©2014 NTT corp. All Rights Reserved.

Tractable Probabilistic Models

[Poon+ 11] Hoifung Poon and Pedro Domingos: “Sum-Product Networks: A New Deep Architecture”,

UAI11

[Gens+ 12] Robert Gens and Pedro Domingos: “Discriminative Learning of Sum-Product Networks”,

NIPS12

[Gens+ 13] Robert Gens and Pedro Domingos: “Learning the Structure of Sum-Product Networks”,

ICML13

[Rooshenas+ 14] Amirmohammad Rooshenas and Daniel Lowd: “Learning Sum-Product Networks with

Direct and Indirect Variable Interactions”, ICML14

[Niepert+ 14b] Mathias Niepert and Pedro Domingos: “Exchangeable Variable Models”, ICML14

[Ishihata+ 14] Masakazu Ishihata and Tomoharu Iwata: “Generating structure of latent variable models

for nested data”, UAI14