Gradient of Gaussian Mixture Model (GMM), with respect to mean and probability $a_i$.
A GMM assumes that data has been sampled from the distribution
$$p(\textbf{x}\mid \textbf{a}, \textbf{μ}, \textbf{Σ)} = \sum_{i=1}^K a_i \mathcal{N}(\textbf{x}\mid \textbf{μ}_i, \textbf{Σ}_i)$$
where (a, μ, Σ) are the parameters of the model. The Maximum Likelihood objective is defined as:
$$L = -\sum_{i=1}^N \log(p(\textbf{x}^{(i)}\mid \textbf{a}, \textbf{μ}, \textbf{Σ)}).$$
My goal is to derive the gradient of the loss $L$ with respect to $a_k$ and μ$_k$. After some differentiation, I reached the following results:
$$\frac{\partial L}{\partial a_k} = -\sum\limits_{i=1}^N \frac{\mathcal{N}(\textbf{x}^{(i)}\mid \textbf{μ}_k, \textbf{Σ}_k)}{p(\textbf{x}^{(i)}\mid \textbf{a}, \textbf{μ}, \textbf{Σ)}},$$
$$\frac{\partial L}{\partial \textbf{μ}_k} = -\sum\limits_{i=1}^N a_k\left(\textbf{x}^{(i)} - \textbf{μ}_k\right)^T\textbf{Σ}_k^{-1} \frac{\mathcal{N}(\textbf{x}^{(i)}\mid \textbf{μ}_k, \textbf{Σ}_k)}{p(\textbf{x}^{(i)}\mid \textbf{a}, \textbf{μ}, \textbf{Σ)}}$$
I am quite doubtful about those results though, so I was wondering if someone could verify them for me (if needed I will also post the calculations).