C2_W3_Lab 3 Doubt (Newton's method for 2 variables)

def newtons_method_2(f, grad_f, hessian_f, x_y, num_iterations=100):
    for iteration in range(num_iterations):
        x_y = x_y - np.matmul(np.linalg.inv(hessian_f(x_y[0,0], x_y[1,0])), grad_f(x_y[0,0], x_y[1,0]))
    return x_y

In the above code the function has been defined to take “f” as a parameter.
But it does not make use of it in the code.

Hey @Debatreyo_Roy,
I think it’s not something that one needs to be concerned with. While curating this lab, the developers might have thought that the function would be used inside the function newtons_method_2, but it wasn’t needed, so they just left it like that.

I don’t think it interferes in any possible way with the lessons that the lab is designed to impart.