第 12 周:大数据解决方案
Summary 摘要
Gradient descent for linear regression
线性回归的梯度下降
Gradient descent can be used to solve many things. Today we used it to build a linear regression model.
梯度下降法可以用来解决很多问题。今天,我们用它来建立一个线性回归模型。
Our objective function is:
我们的目标函数是
Our gradients are: 我们的梯度是
Hence, our final update equations for and are:
因此, 和 的最终更新方程为
Loss curves 损耗曲线
Loss curves are used to observe a model's training process. In general, you want to see that at each iteration the error is reducing.
损失曲线用于观察模型的训练过程。一般来说,您希望看到每次迭代时误差都在减少。
Here are some examples of loss curves that you might see.
下面是一些您可能会看到的损失曲线示例。
Mini-batch gradient descent
小批量梯度下降
Mini-batch gradient descent is a variant of gradient descent where at each iteration, the gradient is calculated for only a subset of the full training data.
迷你批量梯度下降法是梯度下降法的一种变体,每次迭代时,只对全部训练数据的一个子集计算梯度。
Stochastic gradient descent is a special case of mini-batch gradient descent where the batch size is 1.
随机梯度下降法是迷你批次梯度下降法的一种特例,其批次大小为 1。