$$
\begin{array}{l} \nabla_ {\boldsymbol {x}} \log q (\boldsymbol {x}) (51) \\ = - \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| \boldsymbol {x} \| _ {2} ^ {2} - \| \sigma M _ {1} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| \boldsymbol {x} \| _ {2} ^ {2} - \| \sigma M _ {K} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \end{array} \right]\right) M _ {k} M _ {k} ^ {*} \boldsymbol {x} (52) \\ = - \frac {1}{\sigma^ {2}} \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| \boldsymbol {x} \| _ {2} ^ {2} - \| \left(\boldsymbol {I} _ {d} - \boldsymbol {P} _ {1}\right) ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| \boldsymbol {x} \| _ {2} ^ {2} - \| \left(\boldsymbol {I} _ {d} - \boldsymbol {P} _ {K}\right) ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \end{array} \right]\right) \left(\boldsymbol {I} _ {d} - \boldsymbol {P} _ {k}\right) \left(\boldsymbol {I} _ {d} - \boldsymbol {P} _ {k}\right) ^ {*} \boldsymbol {x} (53) \\ \approx - \frac {1}{\sigma^ {2}} \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| P _ {1} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| P _ {K} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \end{array} \right]\right) \left(\boldsymbol {I} _ {d} - \boldsymbol {P} _ {k}\right) \left(\boldsymbol {I} _ {d} - \boldsymbol {P} _ {k}\right) ^ {*} \boldsymbol {x} (54) \\ \approx - \frac {1}{\sigma^ {2}} \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| P _ {1} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| P _ {K} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \end{array} \right]\right) \left(\boldsymbol {I} _ {d} - \boldsymbol {P} _ {k}\right) ^ {*} \boldsymbol {x} (55) \\ = - \frac {\boldsymbol {x}}{\sigma^ {2}} \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| P _ {1} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| P _ {K} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \end{array} \right]\right) + \frac {1}{\sigma^ {2}} \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| P _ {1} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| P _ {K} ^ {*} \boldbf {x} \| _ {2} ^ {2} \end{array} \right]\right) \boldsymbol {P} _ {k} ^ {*} \boldsymbol {x} (56) \\ = - \frac {1}{\sigma^ {2}} \boldsymbol {x} + \frac {1}{\sigma^ {2}} \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| P _ {1} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| P _ {K} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \end{array} \right]\right) \boldsymbol {P} _ {k} ^ {*} \boldsymbol {x} (57) \\ \approx - \frac {1}{\sigma^ {2}} \boldsymbol {x} + \frac {1}{\sigma^ {2}} \sum_ {k = 1} ^ {K} e _ {k} ^ {*} \operatorname {s o f t m a x} \left(\frac {1}{2 \sigma^ {2}} \left[ \begin{array}{c} \| U _ {1} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \\ \vdots \\ \| U _ {K} ^ {*} \boldsymbol {x} \| _ {2} ^ {2} \end{array} \right]\right) \boldsymbol {U} _ {k} \boldsymbol {U} _ {k} ^ {*} \boldsymbol {x} (58) \\ \end{array}
$$