0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PRML 演習問題5.29(基本) 解答

Last updated at Posted at 2020-07-15


##はじめに
本記事は, 機械学習の教科書の決定版ともいえる, Christopher Bishop先生による『Pattern Recognition and Machine Learning (パターン認識と機械学習)』, 通称PRMLの演習問題のうち, 私が解いた問題の解答を記したものです

今回は演習5.29の証明です

##問題

以下の式5.141の結果を確かめるという問題です

\frac{\partial \widetilde{E}}{\partial w_{i}}=\frac{\partial E}{\partial w_{i}}+\sum_{j} \gamma_{j}\left(w_{i}\right) \frac{\left(w_{i}-\mu_{j}\right)}{\sigma_{j}^{2}}\quad(\text { 5.141 }) \\

##解答

教科書より

\widetilde{E}(\mathbf{w})=E(\mathbf{w})+\Omega(\mathbf{w})\quad(\text { 5.139 }) \\

なのでこれを重み$w_{i}$で微分すると

\frac{\partial \widetilde{E}}{\partial w_{i}}=\frac{\partial E}{\partial w_{i}}+ \frac{\partial \Omega}{\partial w_{i}}\quad(\text {!}) \\

となります。あとは右辺の第二項を書き換えれば良いことが分かります。5.138式より

\Omega(\mathbf{w})=-\sum_{i} \ln \left(\sum_{j=1}^{M} \pi_{j} \mathcal{N}\left(w_{i} \mid \mu_{j}, \sigma_{j}^{2}\right)\right)\quad(\text { 5.138 }) \\

でありこれを微分すると

\frac{\partial \Omega}{\partial w_{i}}=\frac{1}{\sum_{k} \pi_{k} \mathcal{N}\left(w_{i} \mid \mu_{k}, \sigma_{k}^{2}\right)} \sum_{j} \pi_{j} \mathcal{N}\left(w_{i} \mid \mu_{j}, \sigma_{j}^{2}\right) \frac{\left(w_{i}-\mu_{j}\right)}{\sigma^{2}}\quad(\text {!!}) \\

が得られます

ここでは、一般に$\mathcal{N}\left(x \mid \mu, \sigma^{2}\right)$の$x$による微分は以下のようになることを用いています。

\mathcal{N}\left(x \mid \mu, \sigma^{2}\right)=\frac{1}{\left(2 \pi \sigma^{2}\right)^{1 / 2}} \exp \left\{-\frac{1}{2 \sigma^{2}}(x-\mu)^{2}\right\}

のとき

\frac{\partial \mathcal{N}}{\partial x}=-\frac{\left(x-\mu\right)}{\sigma^{2}}\mathcal{N}\left(x \mid \mu, \sigma^{2}\right) 


5.140式を利用すると

\gamma_{j}(w)=\frac{\pi_{j} \mathcal{N}\left(w \mid \mu_{j}, \sigma_{j}^{2}\right)}{\sum_{k} \pi_{k} \mathcal{N}\left(w \mid \mu_{k}, \sigma_{k}^{2}\right)}\quad(\text { 5.140 }) \\

(!!)は

\frac{\partial \Omega}{\partial w_{i}}=\sum_{j} \gamma_{j}\left(w_{i}\right) \frac{\left(w_{i}-\mu_{j}\right)}{\sigma_{j}^{2}}

と書き換えられます

これを(!)に代入して

\frac{\partial \widetilde{E}}{\partial w_{i}}=\frac{\partial E}{\partial w_{i}}+ \sum_{j} \gamma_{j}\left(w_{i}\right) \frac{\left(w_{i}-\mu_{j}\right)}{\sigma_{j}^{2}}\quad(\text { 5.141 }) \\

が示されます

参考:https://www.microsoft.com/en-us/research/wp-content/uploads/2016/05/prml-web-sol-2009-09-08.pdf

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?