0%

CS329 Machine Learning Quiz 2

Before Quiz


Question 1 Generative Gaussian Mixture

Question 1.1

$p(x)=\pi\mathcal N(x\vert\mu_1,\Sigma_1)+(1-\pi)\mathcal N(x\vert\mu_2,\Sigma_2)$

Given $\mathbf x=[x_1,\dots,x_N]$, $\mathbf t=[t_1,\dots,t_N]$

What’s the ML estimation of $\mu_1,\Sigma_1,\mu_2,\Sigma_2,\pi$?

Solution 1.1

Derive log-likelihood function w.r.t. $\pi$,

Derive log-likelihood function w.r.t. $\mu_i$,

Derive log-likelihood function w.r.t. $\Sigma_i$,

Hence we have

where

  • $N_1$ is the number of data points in class 1,
  • $N_2$ is the number of data points in class 2.

Question 1.2

$\pi\sim beta(a_0,b_0), p(\mu_i) = \mathcal N(m_{i0},\Sigma_{i0}), i=1,2$

Given $\mathbf x=[x_1,\dots,x_N]$, $\mathbf t=[t_1,\dots,t_N]$

What’s the MAP estimation of $\mu_1,\Sigma_1,\mu_2,\Sigma_2,\pi$?

Solution 1.2

Posterior of $\pi$:

By using the property of product of Gaussian distributions, we obtain the MAP estimation of $\mu_i$ and $\Sigma_i$

Question 1.3

What’s $p(\mathcal C_1\vert x)$ for ML and MAP models respectively?

Solution 1.3

By Bayes’ Theorem,


Question 2 Discriminative Logistic Regression

Question 2.1

$y=\sigma(w^\text T\phi(x))$

Given $\mathbf x=[x_1,\dots,x_N]$, $\mathbf t=[t_1,\dots,t_N]$

What’s the ML estimation of $q(w)$?

Solution 2.1

By Gauss-Newton iteration: $w^\text{new}=w^\text{old}-H^{-1}\nabla E(w)$, we obtain $w_\text{ML}$,

where

Hence

Question 2.2

$y=\sigma(w^\text T\phi(x))$, $p(w)\sim\mathcal N(m_0,\Sigma_0)$

Given $\mathbf x=[x_1,\dots,x_N]$, $\mathbf t=[t_1,\dots,t_N]$

What’s the MAP estimation of $q(w)$?

Solution 2.2

By Gauss-Newton iteration: $w^\text{new}=w^\text{old}-H^{-1}\nabla E(w)$, we obtain $w_\text{ML}$,

where

Hence

Question 2.3

What’s $p(t\vert y(w,x))$ for ML and MAP estimation, respectively?

Solution 2.3

Probability of $t=1$ w.r.t. ML and MAP estimations