35
SampleSearch: A scheme that searches for Consistent Samples Vibhav Gogate and Rina Dechter University of California, Irvine USA

SampleSearch: A scheme that searches for Consistent Samples

  • Upload
    diane

  • View
    19

  • Download
    0

Embed Size (px)

DESCRIPTION

SampleSearch: A scheme that searches for Consistent Samples. Vibhav Gogate and Rina Dechter University of California, Irvine USA. Outline. Background Bayesian Networks with Zero probabilities Importance Sampling Rejection Problem The SampleSearch Scheme Algorithm - PowerPoint PPT Presentation

Citation preview

Page 1: SampleSearch: A scheme that searches for Consistent Samples

SampleSearch: A scheme that searches for Consistent

Samples

Vibhav Gogate and Rina Dechter

University of California, IrvineUSA

Page 2: SampleSearch: A scheme that searches for Consistent Samples

Outline Background

Bayesian Networks with Zero probabilities Importance Sampling Rejection Problem

The SampleSearch Scheme Algorithm Sampling Distribution and its Approximation

Experimental Results

Page 3: SampleSearch: A scheme that searches for Consistent Samples

Bayesian Networks: Representation(Pearl, 1988)

))(|()(

))(|(

1

i

n

i

i

ii

XpaXPXP

XpaXP

:CPTs

lung Cancer

Smoking

X-ray

Bronchitis

DyspnoeaP(D|C,B)

P(B|S)

P(S)

P(X|C,S)

P(C|S)

P(S, C, B, X, D) = P(S) P(C|S) P(B|S) P(X|C,S) P(D|C,B)

(A) Probability of EvidenceP(smoking=no, dyspnoea=yes)=?

(B) Belief Updating:P (lung cancer=yes | smoking=no, dyspnoea=yes ) = ?

Page 4: SampleSearch: A scheme that searches for Consistent Samples

Complexity Belief Updating

NP-hard when zeros are present General case when all CPTs are positive, not known. Relative Approximation

Randomized Polynomial time algorithm when all CPTs are positive (Dagum and Luby 1997)

Probability of Evidence NP-hard when zeros are present Relative Approximation

Randomized Polynomial time algorithm when all CPTs are positive and (1/P(e)) is polynomial (Karp, Dagum and Luby 1993)

Page 5: SampleSearch: A scheme that searches for Consistent Samples

Importance Sampling (Rubinstein ’81)

N

i i

i

N

Q

Xx

Xx

)Q(x

)f(x

NM:

). from Q(x,...,x,xsamples xGenerate

Q(x) f(x)

Q(x)

f(x)EQ(x)

Q(x)

f(x)M

rite n Q(x) rewistributioroposal) dGiven a (p

f(x)M

1

21

1~sampling Importance

00

Page 6: SampleSearch: A scheme that searches for Consistent Samples

Importance Sampling for Belief Updating

EX

eE

XiEX

eExiXi

iiii

XP

XP

eP

exXPexXP

\

|

)(\

,|

)(

)(

)(

),()|(

Zz

eExiXi

zfM

XPzf

XiEXZ

)(1

)()(

)(\

,|

Yy

eE

yfM

XPyf

EXY

)(2

,)()(

\

|

Page 7: SampleSearch: A scheme that searches for Consistent Samples

Generating i.i.d. samples from Q

Q(A,B,C)=Q(A)*Q(B|A)*Q(C|A,B)

Q(A)=(0.8,0.2) Q(B|A)=(0.4,0.6,0.2,0.8) Q(C|A,B)=Q(C)=(0.2,0.8)

A=0

B=0 B=1 B=0 B=1

A=1

C=1C=1C=1 C=0 C=0 C=0 C=1

Root

0.8 0.2

0.4 0.6

0.2 0.8 0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

C=0

),...,|(.....*)|(*)( 11121 nn XXXQXXQXQ Q(X)

Page 8: SampleSearch: A scheme that searches for Consistent Samples

Rejection Problem Importance Sampling requirement

f(xi)>0 => Q(xi)>0

Conversely, Q(xi) can be >0 even if f(xi)=0.

So if the probability of sampling ∑Q(xi|f(xi)>0) is very small A large number of assignments will have zero

weight Extreme case: Our approximation = zero.

N

i i

i

xQ

xf

NM

1 )(

)(1~

Page 9: SampleSearch: A scheme that searches for Consistent Samples

Rejection Problem

All Blue leaves correspond to solutions i.e. f(x) >0All Red leaves correspond to non-solutions i.e. f(x)=0

solution. anot is xif 0)(

)(

)(1~ :sampling Importance

i

1

i

N

i i

i

xf

xQ

xf

NM

A=0

B=0

C=0

B=1 B=0 B=1

A=1

C=1C=1C=1 C=0 C=0 C=0 C=1

Root

0.8 0.2

0.4 0.6

0.2 0.8 0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Page 10: SampleSearch: A scheme that searches for Consistent Samples

Example: map coloring Variables - countries (A,B,C,etc.)

Values - colors (red, green, blue)

Constraints:

A Solution is an assignment that satisfies all constraints

etc. ,ED D, AB,A

C

A

B

DE

F

G

Constraint Networks (Dechter 2003)

Page 11: SampleSearch: A scheme that searches for Consistent Samples

Constraint networks to model “zeros”

A

F

C

D

B

G

A C P(C|A)

0 0 0

0 1 1

1 0 1

1 1 0

Constraints

A=0, C=0 not allowed

A=1, C=1 not allowed

Or A≠C

Why constraints?

• For a partial sample if a constraint is violated f(X=x)=0 for any full extension X=x of the sample.

•For every full assignment X=x

•solution implies f(X=x) >0 and

•non-solution f(X=x)=0

Page 12: SampleSearch: A scheme that searches for Consistent Samples

Using Constraints

A=0

B=0

C=0

B=1 B=0 B=1

A=1

C=1C=1C=1 C=0 C=0 C=0 C=1

Root

0.8 0.2

0.4 0.6

0.2 0.8 0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Constraints

A≠B, A≠C

solution. anot is xif 0)(

)(

)(1~ :sampling Importance

i

1

i

N

i i

i

xf

xQ

xf

NM

Page 13: SampleSearch: A scheme that searches for Consistent Samples

Using Constraints

A=0

B=0 B=1

C=1C=1 C=0 C=0

Root

0.8

0.4 0.6

0.2 0.8 0.2 0.8

C=0

Constraints

A≠B, A≠C

Constraint A≠B violated

solution. anot is xif 0)(

)(

)(1~ :sampling Importance

i

1

i

N

i i

i

xf

xQ

xf

NM

Page 14: SampleSearch: A scheme that searches for Consistent Samples

Outline BackgroundBackground

Bayesian NetworksBayesian Networks Importance SamplingImportance Sampling Rejection PrblemRejection Prblem

The SampleSearch Scheme Algorithm Sampling Distribution and Approximation

Experimental Results

Page 15: SampleSearch: A scheme that searches for Consistent Samples

Algorithm SampleSearch

A=0

B=0

C=0

B=1 B=0 B=1

A=1

C=1C=1C=1 C=0 C=0 C=0 C=1

Root

0.8 0.2

0.4 0.6

0.2 0.8 0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Constraints

A≠B, A≠C

Page 16: SampleSearch: A scheme that searches for Consistent Samples

Algorithm SampleSearch

A=0

B=0

C=0

B=1 B=0 B=1

A=1

C=1C=1C=1 C=0 C=0 C=0 C=1

Root

0.8 0.2

0.4 0.6

0.2 0.8 0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Constraints

A≠B, A≠C

1

Page 17: SampleSearch: A scheme that searches for Consistent Samples

Algorithm SampleSearch

A=0

B=1 B=0 B=1

A=1

C=1C=1C=0 C=0 C=0 C=1

Root

0.8 0.2

0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Constraints

A≠B, A≠C

Resume Sampling

1

Page 18: SampleSearch: A scheme that searches for Consistent Samples

Algorithm SampleSearch

A=0

B=1 B=0 B=1

A=1

C=1C=1C=0 C=0 C=0 C=1

Root

0.8 0.2

1

0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Constraints

A≠B, A≠C

Constraint Violated Until Solution i.e. f(x)>0 found

1

Page 19: SampleSearch: A scheme that searches for Consistent Samples

Generate more Samples

A=0

B=0

C=0

B=1 B=0 B=1

A=1

C=1C=1C=1 C=0 C=0 C=0 C=1

Root

0.8 0.2

0.4 0.6

0.2 0.8 0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Constraints

A≠B, A≠C

Page 20: SampleSearch: A scheme that searches for Consistent Samples

Generate more Samples

A=0

B=0

C=0

B=1 B=0 B=1

A=1

C=1C=1C=1 C=0 C=0 C=0 C=1

Root

0.8 0.2

0.4 0.6

0.2 0.8 0.2 0.8 0.2 0.8 0.2 0.8

0.2 0.8

Constraints

A≠B, A≠C

1

Page 21: SampleSearch: A scheme that searches for Consistent Samples

Traces of SampleSearch

A=0

B=1

C=1

Root

A=0

B=0B=1

C=1

Root

A=0

B=1

C=1

Root

C=0

A=0

B=0 B=1

C=1

Root

C=0

Constraints

A≠B, A≠C

Page 22: SampleSearch: A scheme that searches for Consistent Samples

The Sampling distribution QR of SampleSearch

A=0

B=0 B=1

C=1C=1 C=0

Root

0.8

0 1

0 0 0 1

C=0

What is probability of generating A=0?

QR(A=0)=0.8

Why? SampleSearch is systematic

What is probability of generating B=1?

QR(B=1|A=0)=1

Why? SampleSearch is systematic

What is probability of generating B=0?

Simple: QR(B=0|A=0)=0

All samples generated by SampleSearch are solutions

Did you generate samples from Q? -NO!

Backtrack-free distribution

N

i i

i

xQ

xf

NM

1 )(

)(1~

Page 23: SampleSearch: A scheme that searches for Consistent Samples

Computing QR

Invoke an oracle or a complete search procedure O(n) times per sample

A=0

B=1

C=1

Root

?? Solution

?? Solution

?? Solution

Page 24: SampleSearch: A scheme that searches for Consistent Samples

Approximation AR of QR

A=0

B=0 B=1

C=1C=1 C=0

Root

0.8

0 1

0 0 0 1

C=0

Hole

Don’t know

No solutions here

No solutions here

•IF Hole THEN AR=Q

•IF No solutions on the other branch THEN AR=1

Page 25: SampleSearch: A scheme that searches for Consistent Samples

Approximation AR of QR

A=0

B=1

C=1

Root

A=0

B=0 B=1

C=1

Root

C=0

Problem: Can’t guarantee convergence

?

?

0.8 0.8

0.6 1

0.8

A=0

B=0B=1

C=1

Root

0.8

?

1

0.8

A=0

B=1

C=1

Root

C=0

0.8

?

0.6

1 1

Page 26: SampleSearch: A scheme that searches for Consistent Samples

Guarantee convergence in the limit Store all possible traces

A=0

B=1

C=1

Root

C=0

0.8

?

0.6

1

A=0

B=0B=1

C=1

Root

0.8

?

1

0.8

Approximation ARN

IF Hole THEN ARN=Q

IF No solutions on other branch THEN AR

N=1

unbiasedallyAsymptotic

MxA

xfE

xQ

xfExfM

RN

N

RXx

])(

)([lim

])(

)([)(

A=0

B=1

C=1

Root

0.8

1

1

?

Page 27: SampleSearch: A scheme that searches for Consistent Samples

Improving Naive SampleSeach

Handle Non-binary domains See the paper, Proof is complicated.

Better Search Strategy Can use any state-of-the-art CSP/SAT solver e.g.

minisat (Sorrenson et al 2006) All theorems and result hold

Better Importance Function Use output of generalized belief propagation to

compute the initial importance function Q (Gogate and Dechter 2005)

Page 28: SampleSearch: A scheme that searches for Consistent Samples

Experimental Results Previous Algorithms

Likelihood weighting (LW) Proposal=Prior

IJGP-sampling (IJGP-S) (Gogate and Dechter 2005) Proposal=Output of generalized belief propagation

Adding SampleSearch SampleSearch with LW (S+LW) SampleSearch with IJGP-sampling (S+IJGP-S)

Page 29: SampleSearch: A scheme that searches for Consistent Samples
Page 30: SampleSearch: A scheme that searches for Consistent Samples
Page 31: SampleSearch: A scheme that searches for Consistent Samples

Linkage BN_69

Page 32: SampleSearch: A scheme that searches for Consistent Samples

Linkage BN_73

Page 33: SampleSearch: A scheme that searches for Consistent Samples

Linkage BN_76

Page 34: SampleSearch: A scheme that searches for Consistent Samples
Page 35: SampleSearch: A scheme that searches for Consistent Samples

Conclusions

• Belief networks with zero probabilities lead to the Rejection problem in importance Sampling.

• We presented a SampleSearch scheme that works with any importance sampling scheme to circumvent the Rejection Problem.

• Sampling Distribution of SampleSearch is the backtrack-free distribution QR

– Expensive to compute– Approximation of QR based on storing all traces that yields an

asymptotically unbiased estimator• Empirically, when a substantial number of zero

probabilities are present, SampleSearch based schemes dominate their pure sampling counter-parts.