Closed surtich closed 3 years ago
There is an error in the number of runs to reach the minimum using the coordinate descent algorithm for this equation:
coordinate descent algorithm
g(w1, w2) = 2w1² + 2w² + 2w1w2
The minimum is not reached in just two iterations.
The problem is that you call the algorithm with integer values for the initial estimate of the w vector.
But if you use float values instead:
w = np.array([3.0,4.0]) max_its = 5 weight_history,cost_history = coordinate_descent_for_quadratic(g,w,max_its,a,b,C)
You get the correct values:
[array([3., 4.]), array([-2., 4.]), array([-2., 1.]), array([-0.5, 1. ]), array([-0.5 , 0.25]), array([-0.125, 0.25 ]), array([-0.125 , 0.0625]), array([-0.03125, 0.0625 ]), array([-0.03125 , 0.015625]), array([-0.0078125, 0.015625 ]), array([-0.0078125 , 0.00390625])]```
@surtich Thanks for pointing this out! We've updated Figure 3.4 as follows
There is an error in the number of runs to reach the minimum using the
coordinate descent algorithm
for this equation:g(w1, w2) = 2w1² + 2w² + 2w1w2
The minimum is not reached in just two iterations.
The problem is that you call the algorithm with integer values for the initial estimate of the w vector.
But if you use float values instead:
You get the correct values: