# UNQ_C3 # GRADED FUNCTION: compute_gradient, Logistic regression with loops

While implementing the compute gradient function using with loops I encountered issue with with non-zero w, when w was initialized with zeroes, it worked fine, and gave the expected results

HI @SUBHAN_ALI

Welcome to the community

I think that you used initial_w, and initial_b while you implemented the gradient descent function (compute_gradient()) so your code is run first test correctly but you code didn’t generalize with all test cases to pass so make sure you used variables w, and b in function compute_gradient() instead of using initial_w, and initial_b variables

Cheers!
Abdelrahman

2 Likes