# Optional Lab: Gradient Descent for Linear Regression(plt_gradients))

I am puzzled with the code In [9] which appears after presenting the cumpute_gradient(x, y, w, b) method.
In [9] plt_gradients(x_train,y_train, compute_cost, compute_gradient)

I googled plt_gradients and it seems it is not a funtion in matplotlib or is it? if it is not, then where was this funtion defined ?
regardless, I am puzzled how th’s code outputs the informative chart on gradient since it takes functions as inputs but these functions requre parameters such as x y w b. no?
I know that funtions can take functions as input in pyhton but still cant figure out how it works in this example.

Open the notebook File menu, and you’ll find the utility python files. You can view them in your browser.

1 Like