Skip to content

Commit

Permalink
随机梯度下降法实现
Browse files Browse the repository at this point in the history
  • Loading branch information
cr-mao committed Aug 26, 2024
1 parent 59e6d6b commit 522e6a5
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 230 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jupyter notebook ,numpy,pandas,matplotlib
- [模拟实现梯度下降法(单变量)](machinelearning/gradientDescent/01-GradientDescentSimulations/01-GradientDescentSimulations.ipynb)
- [在线性回归中实现梯度下降法](machinelearning/gradientDescent/02-ImplementGradientDescentInLinearRegression/02-ImplementGradientDescentInLinearRegression.ipynb)
- [梯度下降向量化公式及性能和正规方程对比](machinelearning/gradientDescent/03-VectorizeGradientDescent/03-VectorizeGradientDescent.ipynb)
- [随机梯队下降法](machinelearning/gradientDescent/04-StochasticGradientDescent/04-StochasticGradientDescent.ipynb)



Expand Down
15 changes: 15 additions & 0 deletions machinelearning/03梯度下降法.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,19 @@ def dJ(theta, X_b, y):



### 随机梯度下降法

上面的梯度是对所有样本m 进行 梯度计算。 如果m 很大,那么 这个算法可能也是很费时的。

随机梯度下降算法(SG), 这里是取一个样本,公式变乘下图所示

![](images/ml_21.png)


模拟退火的思想

学习率 = t0/ (i_iters (迭代次数) +t1)

经验值t0=5, t1=50


Large diffs are not rendered by default.

This file was deleted.

Binary file added machinelearning/images/ml_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 522e6a5

Please sign in to comment.