天天看點

Optimization: Stochastic Gradient Descent

    • introduction
    • visualizing the loss function
    • optimization
      • random search
      • random local search
      • following the gradient
    • computing the gradient
      • numerically with finite differences
      • analytically with calculus
    • gradient descent

introduction

optimization: finding W minimize the loss function

visualizing the loss function

注意一點f擴充到神經網絡的時候,目标函數不再是凸函數了。存在不可導點,需要用到subgradient ,

optimization

random search

嘗試不同的随機權重,找到最優。

random local search

起點随機,找到一個deltaW使得loss function變小,更新W

following the gradient

梯度下降

computing the gradient

numerically with finite differences

在每個次元上取一個微小量,計算近似的梯度,可以使用centered difference formula: [f(x+h)−f(x−h)]/2h。關鍵是步長 (learning rate)的選擇

efficiency: 可能training set的次元太高,這種方法計算不是很好。

analytically with calculus

gradient check: 這種方法計算出來比較可能會錯,是以一般會和前一種方法的計算值進行比較。

gradient descent、

Mini-batch gradient descent。training set太大的情況下。