Gradient values are the same at different values of w and b

Getting the same values for gradient at different values of w and b. My code is attached.

(Solution code removed by staff)

First, please don’t post your code on the forum. That’s not allowed by the course Honor Code.

Second, it looks like you modified the first line of the compute_gradient() function definition, by changing the names of the variables. Do not do that. Inside the function, your code must use the variables that are defined in the definition.

The ‘w’ and ‘b’ values you’re using inside the for-loop are not defined anywhere in the function, so that’s why your code always gives the same results. Apparently they are global variables.