Connect your moderator Slack workspace to receive post notifications:
Sign in with Slack

Exercise subtask (Task C)

Did somebody manage to rewrite the expression below without a loop?
... for m,s in zip(means,sigmas) ...

list(map(lambda p: compute_log_p(X, *p), zip(means, sigmas)))
is technically without a loop, but it's questionable whether it's what is wanted in the exercise

NumPy's einsum might help.

I guess that a good way would be to rewrite compute_log_p and make it directly work for means and sigmas (i.e arrays with dimensions (2,k) and (2,2,k)) by using np.newaxis inside your function.

Page 1 of 1

Add comment

Post as Anonymous Dont send out notification