Study/Lecture - Basic (38) 썸네일형 리스트형 W10.L8-10. Sampling Based Inference - LDA | INTRO Gibbs Sampler - Parameter Inference 사례 Collapsed Gibbs sampling → Latent Dirichlet Allocation (LDA, Topic modeling) 총 10가지 (Lines) 주제 1. 주제 찾기, 결국 cluster 찾는 문제 (soft clustering) 2. Topic이 얼마만큼 비중을 가지고 나타나는지 3. 각 Topic을 가장 잘 설명하고 있는 단어군 추출 | Latent Dirichlet Allocation Bayesian network plate notation - $\alpha, \beta$ : Prior knowledge (Dirichlet Distribution Prior) - $w$ : Observed word.. W10.L7. Sampling Based Inference - Gibbs Sampling | INTRO Gibbs sampling: A special case of M-H algorithm Metropolis-Hastings Algorithm Proposal Distribution $q$ 가 어떤 특징을 가지고 있는지 알 수 없기 때문에 Acceptance Probability 를 정의하여 Stational Distribution 까지 Converge 하도록 했었음 Gibbs Sampling 왜 Proposal Distribution 을 새로운 걸 잡아? 이미 잘 정의된 $P$ 라는 것이 있는데, 그걸 재사용하지 그래? | Gibbs Sampling Let's suppose $z^t=(z_{k}^{\ t}, z_{-k}^{\ t})$ $$z^* = (z_{k}^{\ *}, z_{-k}^{\ .. W10.L6. Sampling Based Inference - Metropolis-Hastings Algorithm | Metropolis-Hastings Algorithm 주어진 $\pi$ 라고 하는 Ideal 한 Stationary Distribution 이 주어진 상황에서 어떻게 Transition Rule 을 만들어낼 수 있는지! General algorithm of MCMC Current value: $z^{t}$ 현재 Time 에 어떠한 Assignment $z^{t}$ 가 있다고 생각 Propose a candidate $ z^{*}\sim q(z^{*}, z^{t}) $ where $q_t$ is a proposal distribution 다음 Time 에서 Candidate Assignment 를 제안! Ex. 현재 Alarm=False, MC=True 의 Evidence 가 있고, 나머지 Latent.. W10.L5. Sampling Based Inference - Markov Chain for Sampling | Markov Chain for Sampling Problems of the previous samplings? - No use of the past records → Every sampling is independent (낭비, 비효율적) Assigning $Z$ values is a key in the inference - Let's assign the values by sampling result (Sampling 결과로 $Z$ assignment 해보자!) - 확률 P(E | MC=True, A=False) 를 쉽게 알 수 있다하면 ... 이 확률로 Toss a biased coin to assign a value to E (Coin Toss 해서 E 에다가 Assign 해보자 ... E: La.. W10.L4. Sampling Based Inference - Markov Chain | INTRO ML 계열에서 가장 많이 쓰이는 Sampling Method: Gibbs Sampling Gibbs Sampling 은 Metropolis-Hastings Alogirhtm 의 Special Case! | EM Algorithm Unsupervised Learning 에서 Unobserved variable (Latent variable) $Z$ 에 대하여 Marginalize 하고, $P(X \mid \theta) $ 를 Maximize 하려고 하니 로그 안에 들어가서 계산이 쉽지 않았었다 ... $$ \begin{align*} P(X \mid \theta)&=\sum_{Z}P(X, Z \mid \theta) \\ \rightarrow\ \ \ ln P(X \mid \theta)&=ln .. W10.L3. Sampling Based Inference - Importance Sampling | Importance Sampling Rejection sampling ... 너무 많은 Sample 들을 Reject 하더라 ... (비효율적) Reject 없이 할 수 없을까 ...? 보통 Sampling 이란 ... Calculating the expectation of PDF Calculating a certain probability 기대값이나 특정 확률 계산만 잘 할 수 있다면 Sampling 을 무식하게 여러번 하지 않아도 되겠다! $$ E(f)\cong \frac{1}{L}\sum_{l=1}^{L}\frac{p(z^l)}{q(z^l)}f(z^l)=\frac{1}{L}\frac{Z_q}{Z_p}\sum_{l=1}^{L}\frac{\tilde{p}(z^l)}{\tilde{q}{(z_l)}}f.. W10.L2. Sampling Based Inference - Rejection Sampling | Rejection Sampling P(E=T | MC=T, A=F) = ? Iterate many times - Generate a sample from the Bayesian network * Buglary → False * Earthquake → True * Alarm → True ... 그런데 Alarm = True 가 Given 조건에 맞지 않다 ... ... 이 sample 은 쓰기 어렵겠다 ... Reject! ... Sampling 하면서 Given 파트랑 검사를 해보는 것 ... 다시 처음부터 시작 ... - Return * Count(E=T, MC=T, A=F) / # of samples (살아남은 Sample 중에 E=True 개수를 나눠주면 우리가 원하는 확률일 것이다!) | Re.. W10.L1. Sampling Based Inference - Forward Sampling | INTRO EM Algorithm 으로 Parameter Inference 해봤었다. 다른 Approach 로 Parameter Inference 해보면 어떨까? Sampling Based Inference ! | Forward Sampling Topological Order에 따라서 sample을 generate 해볼 수 있다. 엄청나게 많이 던져봐서 관심있는 확률을 찾아내는 것! Distribution 을 찾아내는 것! 동전을 엄청나게 던져서 세어보는 것! - 1000번 던져서 999번은 도둑이 X, 1번은 도둑이 O - 1000번 던져서 998번은 지진이 X, 2번은 지진이 O - 도둑이 들고 지진이 난 상태에서 또 동전을 던져보면 100번 중 95번은 알람이 O, 나머지 5번은 알람이 X - .. 이전 1 2 3 4 5 다음