larry holder school of eecs washington state university
play

Larry Holder School of EECS Washington State University Artificial - PowerPoint PPT Presentation

Larry Holder School of EECS Washington State University Artificial Intelligence 1 } Full joint probability distribution Can answer any query But typically too large } Conditional independence Can reduce the number of probabilities


  1. Larry Holder School of EECS Washington State University Artificial Intelligence 1

  2. } Full joint probability distribution ◦ Can answer any query ◦ But typically too large } Conditional independence ◦ Can reduce the number of probabilities needed ◦ P(X | Y,Z) = P(X | Z), if X independent of Y given Z } Bayesian network ◦ Concise representation of above Artificial Intelligence 2

  3. } Example Artificial Intelligence 3

  4. } Bayesian network is a directed, acyclic graph } Each node corresponds to a random variable } A directed link from node X to node Y implies that X “influences” Y ◦ X is the parent of Y } Each node X has a conditional probability distribution P (X | Parents(X)) ◦ Quantifies the influence on X from its parent nodes ◦ Conditional probability table (CPT) Artificial Intelligence 4

  5. } Represents full joint distribution n Õ = Ù Ù = = = P ( X x ... X x ) P ( X x | parents ( X ) ) 1 1 n n i i i = i 1 n Õ = P ( x ,..., x ) P ( x | parents ( X ) ) 1 n i i = i 1 } Represents conditional independence ◦ E.g., JohnCalls is independent of Burglary and Earthquake given Alarm Artificial Intelligence 5

  6. } P(b,¬e,a,j,m) = ? Artificial Intelligence 6

  7. } Determine set of random variables {X 1 ,…,X n } } Order them so that causes precede effects } For i = 1 to n do ◦ Choose minimal set of parents for X i such that P (X i | X i-1 ,…,X 1 ) = P (X i | Parents(X i )) ◦ For each parent X k insert link from X k to X i ◦ Write down the CPT, P (X i | Parents(X i )) } E.g., Burglary, Earthquake, Alarm, JohnCalls, MaryCalls Artificial Intelligence 7

  8. } Bad orderings lead to more complex networks with more CPT entries a) MaryCalls, JohnCalls, Alarm, Burglary, Earthquake b) MaryCalls, JohnCalls, Earthquake, Burglary, Alarm Artificial Intelligence 8

  9. ¬ toothache toothache } Example: Tooth World ¬ catch ¬ catch catch catch cavity .108 .012 .072 .008 ¬ cavity .016 .064 .144 .576 Artificial Intelligence 9

  10. } Node X is conditionally independent of its non- descendants (Z ij ’s) given its parents (U i ’s) } Markov blanket of node X is X’s parents (U i ’s), children (Y i ’s) and children’s parents (Z ij ’s) } Node X is conditionally independent of all other nodes in the network given its Markov blanket Artificial Intelligence 10

  11. } Want P (X | e) } X is the query variable (can be more than one) } e is an observed event, i.e., values for the evidence variables E = {E 1 ,…,E m } } Any other variables Y are hidden variables } Example ◦ P (Burglary | JohnCalls=true, MaryCalls=true) = ? ◦ X = Burglary ◦ e = {JohnCalls=true, MaryCalls=true} ◦ Y = {Earthquake, Alarm} Artificial Intelligence 11

  12. } Enumerate over all possible values for Y ◦ P (X | e ) = α P (X, e ) = α S y P (X, e , y ) } Example ◦ P (Burglary | JohnCalls=true, MaryCalls=true) ◦ P (B | j, m) = ? Artificial Intelligence 12

  13. } P (B|j,m) = α P(B) S E P(E) S A P(A|B,E) P(j|A) P(m|A) } P(b|j,m) = α P(b) S E P(E) S A P(A|b,E) P(j|A) P(m|A) Artificial Intelligence 13

  14. } P(b|j,m) = α P(b) S E P(E) S A P(A|b,E) P(j|A) P(m|A) Artificial Intelligence 14

  15. function E NUMERATION -A SK ( X, e , bn ) returns a distribution over X inputs : X , the query variable e , observed values of variables E bn , a Bayes net with variables { X } È E È Y // Y = hidden variables Q ( X ) ← a distribution over X , initially empty for each value x i of X do bn .V ARS has variables Q ( x i ) ← E NUMERATE -A LL ( bn .V ARS , e xi ) in cause à effect order where e xi is e extended with X = x i return N ORMALIZE ( Q ( X )) function E NUMERATE -A LL ( vars, e ) returns a real number if E MPTY ? ( vars ) then return 1.0 Y ← F IRST ( vars ) if Y has value y in e then return P( y | parents ( Y )) ´ E NUMERATE -A LL (R EST ( vars ) , e ) else return S y P( y | parents ( Y )) ´ E NUMERATE -A LL (R EST ( vars ) , e y ) where e y is e extended with Y = y Artificial Intelligence 15

  16. } E NUMERATION -A SK evaluates trees using depth- first recursion } Space complexity O(n) } Time complexity O(v n ), where each of n variables has v possible values Artificial Intelligence 16

  17. Note redundant computation Artificial Intelligence 17

  18. } Avoid redundant computation ◦ Dynamic programming ◦ Store intermediate computations and reuse } Eliminate irrelevant variables ◦ Variables that are not an ancestor of a query or evidence variable Artificial Intelligence 18

  19. } General case (any type of network) ◦ Worst case space and time complexity is exponential } Polytree is a network with at most one undirected path between any two nodes ◦ Space and time complexity is linear in size of network Not a polytree Polytree Artificial Intelligence 19

  20. P? B } P (Pit 3,3 | Breeze 3,2 =true) = ? Artificial Intelligence 20

  21. } Exact inference can be too expensive } Approximate inference ◦ Estimate probabilities from sample, rather than computing exactly } Monte Carlo methods ◦ Choose values for hidden variables ◦ Compute query variables ◦ Repeat and average } Direct sampling } Converges to exact inference Artificial Intelligence 21

  22. } Choose value for variables according to their CPT ◦ Consider variables in topological order } E.g., ◦ P (B) = á 0.001,0.999 ñ , B=false ◦ P (E) = á 0.002,0.998 ñ , E=false ◦ P (A|B=false,E=false) = á 0.001,0.999 ñ , A=false ◦ P (J|A=false) = á 0.05,0.95 ñ , J=false ◦ P (M|A=false) = á 0.01,0.99 ñ , M=false ◦ Sample is [false,false,false,false,false] = X x | samples where | = » P ( X x ) i i | samples | Artificial Intelligence 22

  23. } Another example Artificial Intelligence 23

  24. } Commercial ◦ Bayes Server (www.bayesserver.com) ◦ BayesiaLab (www.bayesia.com) ◦ HUGIN (www.hugin.com) } Free ◦ BayesPy (www.bayespy.org) ◦ JavaBayes (www.cs.cmu.edu/~javabayes) ◦ SMILE (www.bayesfusion.com) } Sample networks ◦ www.bnlearn.com/bnrepository Artificial Intelligence 24

  25. } Bayesian networks ◦ Captures full joint probability distribution and conditional independence } Exact inference ◦ Intractable in worst case } Approximate inference ◦ Sampling ◦ Converges to exact inference Artificial Intelligence 25

Recommend


More recommend