Parameter Learning

Parameter Learning

Gradient Descent

  1. The outline of gradient descent:

    • Start with some θ 0 , θ 1 \theta_0,\theta_1 θ0,θ1 (commonly set θ 0 = 0 , θ 1 = 0 \theta_0=0,\theta_1=0 θ0=0,θ1=0)

    • Keep changing θ 0 , θ 1 \theta_0,\theta_1 θ0,θ1 to reduce J ( θ 0 , θ 1 ) J(\theta_0,\theta_1) J(θ0,θ1) until we hopefully end up at a minimum or a local minimum.

      Direction: derivative of cost function.(The slope of tangent is the derivative at the point )

Make steps down the cost function in the direction with the steepest descent

  1. Property :

    The first time we ran the gradient descent, started at a slightly different location would’ve end up with a very different local optimum.

  2. Assignment and Assertion(:= and =)

  3. The gradient descent algorithm is:
    在这里插入图片描述

    1) α \alpha α (learning rate) controls how big a step we take

    2)Simultaneously update θ 0 . . . θ n \theta_0 ...\theta_n θ0...θn

Gradient Descent Intuition

  1. The α \alpha α should not be too small ,or else it would the gradient descent can be slow. It also should not be too large, or else the gradient descent can overshoot the minimum. It may fail to converge or even to be diverge.

  2. Gradient descent can converge to local minimum with fixed learning rate α \alpha α.

    Reason: As we approach a local minimum, gradient descent will automatically take smaller steps, so it is no need to decrease α \alpha α over time.

Gradient Descent For Linear Regression

  1. Derive a new form of the gradient descent equation
    在这里插入图片描述

m is the size of the training set, θ 0 θ_0 θ0 is a constant that will be changing simultaneously with θ 1 \theta_1 θ1 and x i x_{i} xi, y i y_{i} yi are values of the given training set (data).

  1. A derivation of ∂ ∂ θ j J ( θ ) \frac {\partial}{\partial \theta_j}J(\theta) θjJ(θ) for a single example :

在这里插入图片描述

  1. Convex function: bow-shaped function

    Has no other local optimum except for the one global optimum

  2. "Batch" Gradient Descent: Every step of gradient descent uses all of the training example.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值