230603
This commit is contained in:
@@ -19,8 +19,8 @@ def step_gradient(b_current, w_current, points, learningRate):
|
||||
for i in range(len(points)):
|
||||
x = points[i][0]
|
||||
y = points[i][1]
|
||||
b_gradient += -(2 / N) * (y - (w_current * x + b_current) + b_current)
|
||||
w_gradient += -(2 / N) * x * (y - (w_current * x + b_current + b_current))
|
||||
b_gradient += -(2 / N) * (y - (w_current * x + b_current))
|
||||
w_gradient += -(2 / N) * x * (y - (w_current * x + b_current))
|
||||
new_b = b_current - (learningRate * b_gradient)
|
||||
new_w = w_current - (learningRate * w_gradient)
|
||||
return [new_b, new_w]
|
||||
|
||||
Reference in New Issue
Block a user