Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a456c20

Browse files
author
Travis CI
committedMay 18, 2020
Commit from Travis CI for build 27 .
1 parent abbe4bb commit a456c20

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎feed.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.0.1">Jekyll</generator><link href="https://tatsy.github.io/programming-for-beginners/feed.xml" rel="self" type="application/atom+xml" /><link href="https://tatsy.github.io/programming-for-beginners/" rel="alternate" type="text/html" /><updated>2020-05-17T16:10:01+00:00</updated><id>https://tatsy.github.io/programming-for-beginners/feed.xml</id><title type="html">cpp-python-beginners</title><subtitle>初心者向けC++/Pythonプログラミング</subtitle><author><name>Tatsuya Yatagawa</name><email>tatsy.mail@gmail.com</email></author></feed>
1+
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.0.1">Jekyll</generator><link href="https://tatsy.github.io/programming-for-beginners/feed.xml" rel="self" type="application/atom+xml" /><link href="https://tatsy.github.io/programming-for-beginners/" rel="alternate" type="text/html" /><updated>2020-05-18T04:38:55+00:00</updated><id>https://tatsy.github.io/programming-for-beginners/feed.xml</id><title type="html">cpp-python-beginners</title><subtitle>初心者向けC++/Pythonプログラミング</subtitle><author><name>Tatsuya Yatagawa</name><email>tatsy.mail@gmail.com</email></author></feed>

‎python/convolutional-network/index.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,13 @@ <h2 id="学習ループ">学習ループ</h2>
329329

330330
<h2 id="学習の結果とネットワークの改良">学習の結果とネットワークの改良</h2>
331331

332-
<p>MNISTの例であれば、上記のコードで5エポックほど学習すれば、軽く90%以上の精度が出るはずだ。実際に試してみてほしい</p>
332+
<p>さて、上記のMNISTの例だが、おそらく現状の設定のままでは、なかなかロスが下がらず、精度も上がらないのではないかと思う。これにはいくつかの原因があるが、代表的なものは勾配消失と誤差関数の振動である</p>
333333

334-
<p>さて、それでは、ここから精度をさらに上げるにはどうしたら良いだろうか?まずは、ネットワークの非線形性を向上し、誤差逆伝播の効率をあげるため、活性化関数をReLU (rectified linear unit) に変更するとよいだろう。加えて、学習の効率を向上させるためにバッチ正規化を入れると良い。すると、5エポックを待つことなく、あっという間に90%以上の精度は出るはずだ</p>
334+
<p>1つめの問題は活性化関数にsigmoidを使っていることが原因で、sigmoid関数は入力の値が0から遠くなると勾配が急激に0に近づくため、sigmoidが何段も重なると、誤差逆伝搬の途中で伝搬される勾配が0に限りなく小さくなってしまい、学習が進みづらくなってしまう。現在は、ネットワーク途中の活性化関数にsigmoidを使うことはなく、一般にはReLU (rectified linear unit)という閾値関数を使う。また、各畳み込み層で学習しているバイアスの成分が入力データに対して大きく変化しなくて済むように、正規化層を畳み込みと活性化の間に入れると、さらに学習の効率が向上する。多くの場合は、バッチ内のデータの平均と分散を使って正規化するバッチ正規化 (batch normalization)を使うことが多い</p>
335335

336-
<p>これ以外にも、様々な学習のテクニックがあるが、それらについては、ネット上にも多くの記事や実装があるので、各自調べてみてほしい。</p>
336+
<p>次に誤差関数の振動だが、通常のSGDを使うと、ミニバッチ内のデータが十分にデータ全体を近似していない場合に、あまり良い勾配が得られず、そのために誤差関数が良い方向に収束していかないことがある。これを防ぐために、慣性 (momentum)を使う方法や、各パラメータに対する勾配の大きさを元に更新に使う勾配量を調整する方法が多数提案されている。代表的なものはSGD + momentum (PyTorchの場合はSGDの引数にmomentumを入れる), RMSprop, AdaGrad, AdaDelta, Adamなどだ。</p>
337+
338+
<p>上記の改良を加えて上手く学習ができれば、1エポックも回せば軽く90%以上の精度が得られるようになるだろう。これ以外にも、様々な学習のテクニックがあるが、それらについては、ネット上にも多くの記事や実装があるので、各自調べてみてほしい。</p>
337339

338340
</div>
339341

0 commit comments

Comments
 (0)
Please sign in to comment.