๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐“ก๐“ธ๐“ธ๐“ถ5: ๐’ฆ๐‘œ๐“‡๐‘’๐’ถ ๐’ฐ๐“ƒ๐’พ๐“‹/Artificial Intelligence(COSE361)

[์ธ๊ณต์ง€๋Šฅ] 14. Bayesian Networks

1. Definition of Bayesian Networks

 

1) Bayesian networks (= belief networks, Bayesian belief networks, graphical models)

  - Directed graph์ž„

  - Nodes (= Random variable)์™€ Links ๋กœ ๊ตฌ์„ฑ๋จ 

  - node X๋กœ๋ถ€ํ„ฐ node Y๋กœ์˜ links๋กœ ์ด๋ฃจ์–ด์ง„ directed acyclic graph(DAG)

  - X๋Š” causes, Y๋Š” effects

  - Conditional probability distribution P(Xi | Parents(Xi) ) : Xi ์˜ ๋ถ€๋ชจ ๋…ธ๋“œ๋“ค์ด ๋ฐœ์ƒํ•  ๋•Œ Xi๊ฐ€ ๋ฐœ์ƒํ•  ํ™•๋ฅ 

 

์ฆ‰ ~๊ฐ€ ๋ฐœ์ƒํ•  ๋•Œ์˜ ํ™•๋ฅ ์„ ํŠธ๋ฆฌ์ฒ˜๋Ÿผ..? ๊ทธ๋ž˜ํ”„๋กœ ๋‚˜ํƒ€๋ƒ„

 

2) Conditional Probability Table ( = CPT ) : ์กฐ๊ฑด๋ถ€ ํ™•๋ฅ ํ‘œ

  - k๊ฐœ์˜ Boolean parents๊ฐ€ ์žˆ์„ ๊ฒฝ์šฐ ; 2^k ๊ฐœ์˜ ์„ ํ–‰๋œ ํ™•๋ฅ ์ด ์žˆ์Œ -> 2^k๊ฐœ์˜ ํ–‰์„ ๊ฐ€์ง

  - parents๊ฐ€ ์—†์„ ๊ฒฝ์šฐ : prior probabilities

 

  3) Bayesian network์˜ probabilistic inference

    - Joint distribution in the Bayesian network

      P(x1, x2, ... , xn) = ∏ P(xi | x1, ... , xi-1) = ∏ P(xi | Parent(xi))

     ์™œ๋ƒ๋ฉด parent์˜ parent๋ž‘ ํ˜„์žฌ ๋…ธ๋“œ๋ž‘์€ ์„œ๋กœ independentํ•˜๋‹ค. (=conditional independent)

 

   - Query (C๋Š” query, E๋Š” ๊ด€์ธก๋œ evidence)

     P(C | E1, E2 ,..., En) = P(C, E1, E2, ..., En) / P(E1, E2, ..., En)

 

 

2. Constructing Bayesian Networks

 1) Nodes

   - Variables {X1, ..., Xn}

   - cause๋Š” effect๋ณด๋‹ค ๋จผ์ € ์˜ค๊ฒŒ numberingํ•ด์•ผ ๋” ๊ฐ„๋‹จํ•œ bayesian networks๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Œ

 2) Links

   - Acyclic ํ•ด์•ผ ํ•จ 

   - 1๋ถ€ํ„ฐ n๊นŒ์ง€ ๋‹ค์Œ ์ž‘์—…์„ ๋ฐ˜๋ณตํ•œ๋‹ค.

     Xi์— ๋Œ€ํ•ด P(xi | x1 ,.., xi-1 ) = P(xi | Parent(xi) ) ๋ฅผ ๋งŒ์กฑํ•˜๋Š” ๊ฐ€์žฅ ์ž‘์€ set of parents๋ฅผ ๊ณจ๋ผ์„œ parent์™€ Xi ๋ฅผ ์—ฐ๊ฒฐํ•œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  CPTs (์กฐ๊ฑด๋ถ€ ํ™•๋ฅ ํ‘œ) P(Xi | Parent(Xi))๋ฅผ ์ ๋Š”๋‹ค. 

Cause๊ฐ€ Effects๋ณด๋‹ค ์„ ํ–‰๋˜์–ด์•ผ ํ•˜๋Š” ์ด์œ  -> ๋ณต์žกํ•ด์ง ใ…Ž.ใ…Ž..

  - Diagnostic model : effect๋ฅผ ๋ณด๊ณ  cause๋ฅผ ์ง„๋‹จ. ๋ฐ”๋กœ ์œ„ ๊ทธ๋ž˜ํ”„๊ฐ€ ์ด๊ฑฐ์ž„

  - Causal model : ์œ„์œ„ ๊ทธ๋ž˜ํ”„์ฒ˜๋Ÿผ cause๊ฐ€ effect๋ณด๋‹ค ๋จผ์ € ์™€์„œ ์ œ์ผ simpleํ•œ ๊ผด์˜ ๊ทธ๋ž˜ํ”„. ํ™•๋ฅ  ํ•™์Šต์— ์šฉ์ดํ•จ.

 

 

 

3. Inference in Bayesian Networks

  1) Inference by Enumeration

 

 - Query variables and evidence variables.

 

 

P(X|e) = P(X, e) / P(e) = αP(X,e) = α ∑y P(X, e, y)  <- ๋ชจ๋“  y์— ๋Œ€ํ•œ ๊ฐ’์„ ๋”ํ•จ. marginalize

P(v1, v2, ... , vn) = ∏P(vi | v1 ,.., vi-1) = ∏ P(vi | Parent(vi))

 

 

 

...

์ˆ˜๋„์ฝ”๋“œ๋ฅผ ์ดํ•ดํ•ด๋ณด์ž....

 

 - Analysis of Enumeration-Ask Algorithm

    : Space complexity : linear (=DFS)

      Time complexity : n๊ฐœ์˜ boolean variables์ด ์žˆ์„ ๋•Œ O(2^n)

 

 

  2) Variable Elimination Algorithm 

   * Dynamic Programming : ์ €์žฅํ•ด์„œ ํ™œ์šฉํ•˜๊ธฐ

     : enumeration algorithm์€ ๊ณ„์‚ฐ์˜ ๋ฐ˜๋ณต์„ ์—†์• ์„œ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ๋‹ค. 

  -> Variable Elimination Algorithm์ด ๋ฐ”๋กœ ๊ทธ ์•Œ๊ณ ๋ฆฌ์ฆ˜! dynamic program์„ ํ™œ์šฉํ•ด์„œ ๊ธฐ์กด์˜ inference ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ๊ฐœ์„ ํ•œ๋‹ค. (bottom up) 

 

  * Pointwise product

f1 ์ด๋ผ๋Š” ํ•จ์ˆ˜๋Š” A์™€ B์˜ ๊ฐ’์— ๋”ฐ๋ฅธ ํ™•๋ฅ ์„ ๊ฐ–๋Š” ํ•จ์ˆ˜, f2๋Š” B์™€ C์˜ ๊ฐ’์— ๋”ฐ๋ผ ํ™•๋ฅ ์„ ๊ฐ–๋Š” ํ•จ์ˆ˜, f3๋Š” A, B, C์— ๋Œ€ํ•œ ๊ฑด๋ฐ f1๊ณผ f2์˜ ๊ณฑ์œผ๋กœ ๋‚˜ํƒ€๋‚ผ ์ˆ˜ ์žˆ์Œ. ์ด ๋•Œ ๊ณฑ์€, ๋‘ ํ•จ์ˆ˜์˜ ๊ณตํ†ต์ธ ์ธ์ž์ธ B์˜ ์ง„๋ฆฌ๊ฐ’์ด ๊ฐ™์•„์•ผ ํ•ฉ์ณ์ง(๊ณฑํ•ด์งˆ ์ˆ˜ ์žˆ์Œ)

 

์˜ˆ์‹œ )