I'm battling the code for 3 days without any real progress.

Is there a point to submit an un-working code?

]]>1. Calculate $\log P(z_i = j, x_i)$ - do this by using the log of the expression for the pdf of normal directly. Let's call this number $b_{i,j}$.

2. Calculate $\log P(x_i) = \log(\sum_{j=1}^K P(z_i = j, x_i)) = log(\sum_{j=1}^K exp(b_{i,j}))$. This can be done by using the logsumexp function in numpy.

2. Calculate $\log P(z_i = j | x_i)$. By Bayes' law, this is equal to $\log P(z_i = j , x_i) - \log P(x_i)$, which uses quantities calculated in 1+2.

There will be no extra time - this exercise is short, with an extended deadline, and is non-mandatory (in the 5/6 sense). Note that the checker won't pick it up until Monday.

]]>Can we get some directions on how to implement the calculations and some extra time to do it?

Thanks,

Ofer.