【问题标题】:I want to find the minumum point of any discrete function by using gradient descent method我想通过使用梯度下降法找到任何离散函数的最小点
【发布时间】:2015-12-06 07:53:30
【问题描述】:

我想通过使用梯度下降法找到任何离散函数的最小点,但我不知道如何评估函数对特定点的导数。例如

function = [100 81 64 49 36 25 16 9 4 1 0 1 4 9 16 25 36 49 64 81 100]
derivative = [ -19 -17 -15 -13 -11 -9 -7 -5 -3 -1 1 3 5 7 9 11 13 15 17 19]

对于梯度下降算法

x_next = x_now - alfa * derivative(x_now) 

但是我如何评估derivative(x_now)?我希望你能明白我的意思谢谢

【问题讨论】:

标签: optimization gradient


【解决方案1】:

假设您知道与离散函数值对应的 x 值,例如,

x = [-5 -4 -3 -2 ... ],
function = [100 81 64 49 36 ... ],
derivative = [-19 -17 -15 -13 ...],

梯度下降法中的导数可以在每个区间 [x_(i), x_(i+1)) 上取为常数。即,在伪代码中

derivative(x_now) = derivative(x_i), where x_(i) <= x_now < x_(i+1).

作为示例,使用上面的 x 值:

derivative(-3.5) = -15

【讨论】:

    猜你喜欢
    • 2021-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-18
    • 2021-11-07
    • 2021-07-16
    • 2013-10-09
    • 2016-06-13
    相关资源
    最近更新 更多