2
4

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 5 years have passed since last update.

Course 2 > Week 2 Optimization algorithms(Coursera Deep Learning Specialization 受講記録)

Last updated at Posted at 2018-06-09

Coursera > Deep Learning Specialization > Course 2 : Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization > Week 2 Optimization algorithms の受講記録。

概要

Course 2 は3週分の講座から構成される。

  1. Week 1 Practical aspects of Deep Learning
  2. Week 2 Optimization algorithms
  3. Week 3 Hyperparameter tuning, Batch Normalization and Programming Frameworks

今回は Week 2 の受講記録。テーマは最適化の手法。


Optimization algorithms

Mini-batch gradient descent

  • 最急降下法:学習データの全データの誤差を計算してからパラメータ更新
  • 確率的勾配降下法:ランダムに取得したデータ1件ずつ、誤差を計算してパラメータ更新
  • ミニバッチ法:ランダムに取得したm件のデータについて、誤差を計算してパラメータ更新

1エポック=訓練データが1巡

Understanding mini-batch gradient descent

バッチサイズは2のn乗がよい
64とか128とか256とか512とか。

Exponentially weighted averages

日本語だと指数加重移動平均?
個々のデータの値はバラツキがあるのでそのまま使用するのではなく、直近過去のデータの値の平均を使いましょう、というのが基本的なコンセプト。平均といっても単純に母数で割るのではなく直近の値ほど指数関数的に重みをつけて重要視する。

Understanding exponentially weighted averages

Exponentially weighted averagesをもう少し掘り下げる。
単純な平均値を計算するよりも計算のコストとメモリ効率がいいため、機械学習でも使い勝手が良い。

Bias correction in exponentially weighted averages

指数加重移動平均における序盤の時系列データは、その時点から見た過去データが無いので補正が効かない。
そのマイナス分をいいかんじに補正するテクニック = Bias Correction
しかし逆に言うと立ち上がりのデータの値が少なめに偏るだけなので、機械学習ではわざわざ Bias Correction を使う人はあまりいない。

Gradient descent with momentum

Momentum
Gradient descentの計算にExponentially weighted averagesの考え方を適用する。
Learning rate が大き目でも学習が発散しにくい。結果としてSGDに比べて学習速度が早くなる効果がある。

RMSprop

root mean squared propagation
Momentumでは微分した結果(dW,db)についてExponentially weighted averagesの考え方を適用したが、RMSpropでは微分した結果の二乗についてExponentially weighted averagesの考え方を適用する。

Adam optimization algorithm

Adaptive Moment Estimation
MomentumとRMSpropを組み合わせたような手法。
そろそろパラメータや数式がごちゃごちゃしてきて理解が追いつかなくなってくる。。

Momentum,RMSprop,Adamといった最適化手法についてはこのあたり↓も参考になる。
Inside of Deep Learning (ディープラーニングの性能改善手法 一覧)

Learning rate decay

時間の経過と共に徐々に学習率を下げることも学習のスピードアップに役立つ。

The problem of local optima

Local Optima
Saddle Point
コスト関数の勾配が0になるほとんどの場合は局所最適点ではなく鞍点である。
鞍点に変なハマり方をすると学習が進まなくなる。
鞍点のplateau(?上手い訳が思い浮かばないが、要は鞍点からさらに傾斜を降りる方向に…ということだと思う)を駆け降りるために MomentumやRMSprop、Adamなどのアルゴリズムが役に立つ、と説明しているんだと思う。ちょっと英語の理解が難しい。。

参考にしたページ
Understanding Learning Rates and How It Improves Performance in Deep Learning

Programming assignment

Optimization

  • Gradient Descent
  • Mini-Batch Gradient descent
  • Momentum
  • Adam
  • それぞれを比較。今回はAdamがもっともAccuracyが高く、学習の収束も早い。

Heroes of Deep Learning (Optional)

Yuanqing Lin interview

2
4
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
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?