> For the complete documentation index, see [llms.txt](https://json007.gitbook.io/svm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://json007.gitbook.io/svm/math-convex_optimization/sui_ji_ti_du_xia_jiang.md).

# 随机梯度下降

[线性收敛的随机优化算法 之 SAG、SVRG](https://zhuanlan.zhihu.com/p/22402784)\
[Accelerating Stochastic Gradient Descent using Predictive Variance Reduction](https://papers.nips.cc/paper/4937-accelerating-stochastic-gradient-descent-using-predictive-variance-reduction.pdf)

[深度解读最流行的优化算法：梯度下降](http://mp.weixin.qq.com/s?__biz=MzA3MzI4MjgzMw==\&mid=2650720663\&idx=3\&sn=d9f671f77be23a148d1830448154a545\&chksm=871b0de9b06c84ffaf260b9ba2a010108cca62d5ce3dcbd8c98c72c9f786f9cd460b27b496ca\&mpshare=1\&scene=2\&srcid=1121mgll9exVL2Gia7trGTn7\&from=timeline#wechat_redirect)\
[各种优化方法总结比较（sgd/momentum/Nesterov/adagrad/adadelta）](http://blog.csdn.net/luo123n/article/details/48239963)\
[An overview of gradient descent optimization algorithms](http://sebastianruder.com/optimizing-gradient-descent/)

[深度学习最全优化方法总结比较（SGD，Adagrad，Adadelta，Adam，Adamax，Nadam）](https://zhuanlan.zhihu.com/p/22252270)

迭代中存在的各种问题：

* 学习率太大
* 学习率过早调小
* 不同参数学习率不同
* SGD容易卡在鞍点

于是乎SGD很多改进版本出现了。

![](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2F577e0f839b7a9d91e48b079b2561c1a41d58f923.png?generation=1589383929113836\&alt=media)

![](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2F2cc53bf72ea7ca189cef0d2d48ecb241145cd747.png?generation=1589383928887369\&alt=media)

![](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2Ff13178d64e20087d2444cf1e5030999ca2af2d13.gif?generation=1589383939301291\&alt=media)

Imgur网友通过可视化方法，对比了SGD, momentum, Nesterov, AdaGrad, AdaDelta, RMSProp等优化算法在Long Valley, Beale's Function及Saddle Point情况下的性质：[Visualizing Optimization Algos](http://imgur.com/a/Hqolp)

> 注意该链接中最后一个Saddle Point可视图，这个常遇到。

### nesterov momentum

![](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2F65fa12c8745d9b88ebe2d4e70216c34eca05623b.jpeg?generation=1589383938739425\&alt=media)\
理解为：\
momentum ：合并当前点的梯度和 之前几步梯度的累加（因为很多步以前的变成了 $$\gamma^m$$，影响非常小）\
Nesterov momentum：当前点，再向当前累加的梯度冲出一段 ，到达新的点后求梯度， 再加上之前几步的梯度累加。\
[CS231n Convolutional Neural Networks for Visual Recognition](http://cs231n.github.io/neural-networks-3/#sgd)

如何理解momentum：\
原始的是沿着当前点的负梯度走，这个方向仅仅是当前点看上去下降最快的。之前的负梯度是站在之前点上看上去下降最快的方向。可否揉合一点之前的方向，形成的新方向岂不是更有大局观一点！so， the momentum！

### Adam

这个应该更好点吧 [Adam: A Method for Stochastic Optimization](http://arxiv.org/pdf/1412.6980.pdf)\
![](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2F2e325169ae2e3440f89708ad9e4baedd1dc0bd04.png?generation=1589383928706853\&alt=media)

## SGD调参

[Greedy Step Averaging: A parameter-free stochastic optimization method](https://arxiv.org/pdf/1611.03608v1.pdf)\
[轻量级大规模机器学习算法库Fregata开源：快速，无需调参](http://mp.weixin.qq.com/s?__biz=MzA5NzkxMzg1Nw==\&mid=2653161536\&idx=1\&sn=5804c2bde8652aac86dfaec93c4f6190\&chksm=8b49352ebc3ebc384cd5cb7e03e1af7ad30b2deab7cef43a9700ac4fa1cb2810980f0399655a\&mpshare=1\&scene=23\&srcid=1208RY0nqL6zVCYEcblDt7GQ#rd)

![](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2F1353c926b7c93b36d23d7baabec1fd8e93bfbdd1.png?generation=1589383928443465\&alt=media)

GSA算法的核心原理非常简单：在迭代的每一步对单个样本的损失函数做线搜索。具体来说，我们对逻辑回归和softmax回归的交叉熵损失函数，推导出了一套**仅用当前样本点的梯度信息**来计算**精确线搜索步长**的近似公式。我们把利用这套近似公式得到的步长做时间平均来计算当前迭代步的学习率。这样做有两方面的好处：基于精确线搜索得到的步长包含了当前迭代点到全局极小的距离信息——接近收敛时步长比较小，反之则更大，因而保证收敛速度；另一方面平均策略使算法对离群点更鲁棒，损失下降曲线不至剧烈抖动，为算法带来了额外的稳定性。

## L1 Stochastic Gradient Descent

[Stochastic Gradient Descent](http://www.cnblogs.com/vivounicorn/archive/2012/02/24/2365328.html) 比对各种算法的速度和并行化。

以及MLAPP第13章 spare Linear modle，专门讲了 L1问题的各种求解，包括FISTA等。

### 参考佳文

[Incorporating Nesterov Momentum into Adam](http://cs229.stanford.edu/proj2015/054_report.pdf)

《Fast Asynchronous Parallel Stochastic Gradient Decent》快速并行随机梯度下降\
《Stochastic Gradient Descent Tricks》\
[Neural Networks for Machine Learning](http://mooc.guokr.com/note/9711/)\
[BRML/climin](https://github.com/BRML/climin/tree/master/climin) 和 [rmsprop](http://climin.readthedocs.org/en/latest/rmsprop.html)

[Optimization techniques comparison in Julia: SGD, Momentum, Adagrad, Adadelta, Adam](http://int8.io/comparison-of-optimization-techniques-stochastic-gradient-descent-momentum-adagrad-and-adadelta/)

<https://www.zhihu.com/question/49567256/answer/116858150> NIPS 2016 异步SGD
