Top Banner
1 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos
60

11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Mar 27, 2015

Download

Documents

Ashton Watkins
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

11

Sum-Product Networks: A New Deep Architecture

Hoifung PoonMicrosoft Research

Joint work with Pedro Domingos

Page 2: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

2

Graphical Models: Challenges

2

Bayesian Network Markov Network

Sprinkler Rain

Grass Wet

Advantage: Compactly represent probability

Problem: Inference is intractable

Problem: Learning is difficult

Restricted Boltzmann Machine (RBM)

Page 3: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Stack many layersE.g.: DBN [Hinton & Salakhutdinov, 2006]

CDBN [Lee et al., 2009]

DBM [Salakhutdinov & Hinton, 2010]

Potentially much more powerful than shallow architectures [Bengio, 2009]

But … Inference is even harder Learning requires extensive effort

3

Deep Learning

3

Page 4: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Learning: Requires approximate inference

Inference: Still approximate

Graphical Models

4

Page 5: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

E.g., hierarchical mixture model, thin junction tree, etc.

Problem: Too restricted

Graphical Models

Existing Tractable Models

5

Page 6: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

This Talk: Sum-Product Networks

Compactly represent partition function using a deep network

Graphical Models

Existing Tractable Models

Sum-Product Networks

6

Page 7: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Graphical Models

Existing Tractable Models

Sum-Product Networks

Exact inference linear time in network size

7

Page 8: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Graphical Models

Existing Tractable Models

Sum-Product Networks

Can compactly represent many more distributions

8

Page 9: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Graphical Models

Existing Tractable Models

Sum-Product Networks

Learn optimal way to reuse computation, etc.

9

Page 10: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

1010

Outline

Sum-product networks (SPNs) Learning SPN Experimental results Conclusion

Page 11: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Bottleneck: Summing out variables

E.g.: Partition function

Sum of exponentially many products

Why Is Inference Hard?

1 11

( , , ) , ,N j N

j

P X X X XZ

j

X j

Z X

11

Page 12: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Alternative Representation

X1 X2 P(X)

1 1 0.4

1 0 0.2

0 1 0.1

0 0 0.3

P(X) = 0.4 I[X1=1] I[X2=1]

+ 0.2 I[X1=1] I[X2=0]

+ 0.1 I[X1=0] I[X2=1]

+ 0.3 I[X1=0] I[X2=0]

Network Polynomial [Darwiche, 2003]

12

Page 13: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Alternative Representation

X1 X2 P(X)

1 1 0.4

1 0 0.2

0 1 0.1

0 0 0.3

P(X) = 0.4 I[X1=1] I[X2=1]

+ 0.2 I[X1=1] I[X2=0]

+ 0.1 I[X1=0] I[X2=1]

+ 0.3 I[X1=0] I[X2=0]

13

Network Polynomial [Darwiche, 2003]

Page 14: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Shorthand for Indicators

X1 X2 P(X)

1 1 0.4

1 0 0.2

0 1 0.1

0 0 0.3

P(X) = 0.4 X1 X2

+ 0.2 X1 X2

+ 0.1 X1 X2

+ 0.3 X1 X2

14

Network Polynomial [Darwiche, 2003]

Page 15: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Sum Out Variables

X1 X2 P(X)

1 1 0.4

1 0 0.2

0 1 0.1

0 0 0.3

P(e) = 0.4 X1 X2

+ 0.2 X1 X2

+ 0.1 X1 X2

+ 0.3 X1 X2

e: X1 = 1

Set X1 = 1, X1 = 0, X2 = 1, X2 = 1

Easy: Set both indicators to 115

Page 16: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Graphical Representation

0.4

0.2 0.1

0.3

X1 X2 X1

X2

X1 X2 P(X)

1 1 0.4

1 0 0.2

0 1 0.1

0 0 0.3

16

Page 17: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

But … Exponentially Large

Example: Parity Uniform distribution over states with even number of 1’s

17

X2 X2

X3 X3

X1 X1 X4

X4

X5 X5

2N-1

N2N-

1

17

Page 18: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

But … Exponentially Large

Example: Parity Uniform distribution over states of even number of 1’s

18

X2 X2

X3 X3

X1 X1 X4

X4

X5 X5

Can we make this more compact?

18

Page 19: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

19

Use a Deep Network

19

O(N)

Example: Parity Uniform distribution over states with even number of 1’s

Page 20: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

20

Use a Deep Network

20

Example: Parity Uniform distribution over states of even number of 1’s

Induce many hidden layers

Reuse partial computation

Page 21: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Arithmetic Circuits (ACs)

Data structure for efficient inference Darwiche [2003]

Compilation target of Bayesian networks

Key idea: Use ACs instead to define a new class of deep probabilistic models

Develop new deep learning algorithms for this class of models

21

Page 22: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

22

Sum-Product Networks (SPNs) Rooted DAG Nodes: Sum, product, input indicator Weights on edges from sum to children

22

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1

X2

Page 23: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

23

Distribution Defined by SPN

P(X) S(X)

23

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1

X2

23

Page 24: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

2424

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1

X2

1 0 1 1e: X1 = 1

P(e) Xe S(X) S(e)

Can We Sum Out Variables?

=?

Page 25: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

25

Valid SPN

SPN is valid if S(e) = Xe S(X) for all e

Valid Can compute marginals efficiently

Partition function Z can be computed by setting all indicators to 1

25

Page 26: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

26

Valid SPN: General Conditions

Theorem: SPN is valid if it is complete & consistent

26

Incomplete Inconsistent

Complete: Under sum, children cover the same set of variables

Consistent: Under product, no variable in one child and negation in another

S(e) Xe S(X) S(e) Xe S(X)

Page 27: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Semantics of Sums and Products

Product Feature Form feature hierarchy

Sum Mixture (with hidden var. summed out)

27

I[Yi = j]

i

j

…… …… j

wij

i

…… ……

wijSum out Yi

Page 28: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

28

Inference

Probability: P(X) = S(X) / Z

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1 X2

1 0 0 1

0.6 0.9 0.7 0.8

0.42 0.72

X: X1 = 1, X2 = 0

X1 1

X1 0

X2 0

X2 1

0.51

Page 29: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

29

Inference

If weights sum to 1 at each sum node Then Z = 1, P(X) = S(X)

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1 X2

1 0 0 1

0.6 0.9 0.7 0.8

0.42 0.72

X: X1 = 1, X2 = 0

X1 1

X1 0

X2 0

X2 1

0.51

Page 30: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

30

Inference

Marginal: P(e) = S(e) / Z

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1 X2

1 0 1 1

0.6 0.9 1 1

0.6 0.9

0.69 = 0.51 0.18e: X1 = 1

X1 1

X1 0

X2 1

X2 1

Page 31: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

31

Inference

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1 X2

1 0 1 1

0.6 0.9 0.7 0.8

0.42 0.72

0.3 0.72 = 0.216e: X1 = 1

X1 1

X1 0

X2 1

X2 1

MPE: Replace sums with maxes

MAX MAX MAX MAX

MAX

0.7 0.42 = 0.294

Darwiche [2003]

Page 32: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

32

Inference

0.7 0.3

X1 X2

0.80.30.10.20.70.90.4

0.6

X1 X2

1 0 1 1

0.6 0.9 0.7 0.8

0.42 0.72

0.3 0.72 = 0.216e: X1 = 1

X1 1

X1 0

X2 1

X2 1

MAX: Pick child with highest value

MAX MAX MAX MAX

MAX

0.7 0.42 = 0.294

Darwiche [2003]

Page 33: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

33

Handling Continuous Variables

Sum Integral over input

Simplest case: Indicator Gaussian

SPN compactly defines a very large mixture of Gaussians

Page 34: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

34

SPNs Everywhere

Graphical models

34

• Existing tractable mdls. & inference mthds.

• Determinism, context-specific indep., etc.

• Can potentially learn the optimal way

Page 35: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

35

SPNs Everywhere

Graphical models

Methods for efficient inference

35

E.g., arithmetic circuits, AND/OR graphs, case-factor diagrams

SPNs are a class of probabilistic modelsSPNs have validity conditionsSPNs can be learned from data

Page 36: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

36

SPNs Everywhere

Graphical models

Models for efficient inference

General, probabilistic convolutional network

36

Sum: Average-pooling

Max: Max-pooling

Page 37: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

37

SPNs Everywhere

Graphical models

Models for efficient inference

General, probabilistic convolutional network

Grammars in vision and language

37

E.g., object detection grammar,probabilistic context-free grammar

Sum: Non-terminalProduct: Production rule

Page 38: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

3838

Outline

Sum-product networks (SPNs) Learning SPN Experimental results Conclusion

Page 39: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

39

General Approach

Start with a dense SPN

Find the structure by learning weightsZero weights signify absence of connections

Can learn with gradient descent or EM

Page 40: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

4040

The Challenge

Gradient diffusion: Gradient quickly dilutes

Similar problem with EM

Hard EM overcomes this problem

Page 41: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

4141

Our Learning Algorithm

Online learning Hard EM

Sum node maintains counts for each child

For each example Find MPE instantiation with current weights Increment count for each chosen child Renormalize to set new weights

Repeat until convergence

Page 42: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

4242

Outline

Sum-product networks (SPNs) Learning SPN Experimental results Conclusion

Page 43: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

43

Task: Image Completion

Methodology: Learn a model from training images Complete unseen test images Measure mean square errors

Very challenging

Good for evaluating deep models

Page 44: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

44

Datasets

Main evaluation: Caltech-101 [Fei-Fei et al., 2004] 101 categories, e.g., faces, cars, elephants Each category: 30 – 800 images

Also, Olivetti [Samaria & Harter, 1994] (400 faces)

Each category: Last third for test

Test images: Unseen objects

Page 45: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

45

SPN Architecture

Whole Image

Region

Pixel

......

......

x

......

......

y

Page 46: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

46

Decomposition

Page 47: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

47

Decomposition

……

……

Page 48: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

4848

Systems

SPN

DBM [Salakhutdinov & Hinton, 2010]

DBN [Hinton & Salakhutdinov, 2006]

PCA [Turk & Pentland, 1991]

Nearest neighbor [Hays & Efros, 2007]

Page 49: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

49

Caltech: Mean-Square Errors

DBNNN SPN

Left Bottom

PCA DBM DBNNN SPNPCA DBM

Page 50: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

50

SPN vs. DBM / DBN

SPN is order of magnitude faster

No elaborate preprocessing, tuning

Reduced errors by 30-60%

Learned up to 46 layers

SPN DBM / DBN

Learning 2-3 hours Days

Inference < 1 second Minutes or hours

Page 51: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

51

Example Completions

SPN

DBN

Nearest Neighbor

DBM

PCA

Original

Page 52: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

52

Example Completions

SPN

DBN

Nearest Neighbor

DBM

PCA

Original

Page 53: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

53

Example Completions

SPN

DBN

Nearest Neighbor

DBM

PCA

Original

Page 54: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

54

Example Completions

SPN

DBN

Nearest Neighbor

DBM

PCA

Original

Page 55: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

55

Example Completions

SPN

DBN

Nearest Neighbor

DBM

PCA

Original

Page 56: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

56

Example Completions

SPN

DBN

Nearest Neighbor

DBM

PCA

Original

Page 57: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

5757

Open Questions

Other learning algorithms

Discriminative learning

Architecture

Continuous SPNs

Sequential domains

Other applications

Page 58: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

End-to-End Comparison

58

DataGeneral

Graphical ModelsPerformance

DataSum-Product

NetworksPerformance

Approximate Approximate

Approximate Exact

Given same computation budget, which approach has better performance?

Page 59: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

Graphical Models

Existing Tractable Models

Sum-Product Networks

59

True Model Approximate Inference

Optimal SPN

Page 60: 11 Sum-Product Networks: A New Deep Architecture Hoifung Poon Microsoft Research Joint work with Pedro Domingos.

6060

Conclusion

Sum-product networks (SPNs) DAG of sums and products Compactly represent partition function Learn many layers of hidden variables

Exact inference: Linear time in network size

Deep learning: Online hard EM

Substantially outperform state of the art on image completion