So as I am trying to complete the section 2.6 Learning parameters using gradient descent of the logistic regression lab, I encountered this error where according to the instruction there is nothing I need to implement:
compute_gradient() takes 4 positional arguments but 5 were given
I did arrive the same test results in Exercise #3
dj_db at test w and b: -0.5999999999991071
dj_dw at test w and b: [-44.831353617873795, -44.37384124953978]
All tests passed!
So at this point this positional arguments error is super confusing and I dont know what I am missing.
Hey, I’m also facing the same issue at 2.6 Learning parameters using gradient descent. This is the error I’m getting ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
8
9 w,b, J_history,_ = gradient_descent(X_train ,y_train, initial_w, initial_b,
—> 10 compute_cost, compute_gradient, alpha, iterations, 0)
in gradient_descent(X, y, w_in, b_in, cost_function, gradient_function, alpha, num_iters, lambda_)
32
33 # Calculate the gradient and update the parameters
—> 34 dj_db, dj_dw = gradient_function(X, y, w_in, b_in, lambda_)
35
36 # Update Parameters using w, b, alpha and gradient
TypeError: compute_gradient() takes 4 positional arguments but 5 were given
And I passed most of the exercises in the assignment but when I submitted I got 0% and the feedback was Cell #17. Can’t compile the student’s code. Error: TypeError(‘compute_gradient() takes 4 positional arguments but 5 were given’)