Incorrect result for Week3 Q6

UNQ_C6

def compute_gradient_reg(X, y, w, b, lambda_ = 1):
“”"
Computes the gradient for logistic regression with regularization

Args:
  X : (ndarray Shape (m,n)) data, m examples by n features
  y : (ndarray Shape (m,))  target value 
  w : (ndarray Shape (n,))  values of parameters of the model      
  b : (scalar)              value of bias parameter of the model
  lambda_ : (scalar,float)  regularization constant
Returns
  dj_db : (scalar)             The gradient of the cost w.r.t. the parameter b. 
  dj_dw : (ndarray Shape (n,)) The gradient of the cost w.r.t. the parameters w. 

"""
m, n = X.shape
dj_db, dj_dw = compute_gradient(X, y, w, b)

Moderator edit. Code removed.
    
### END CODE HERE ###         
    
return dj_db, dj_dw

This is the assignment for week 3. Got incorrect results. Does anyone know how to fix it?

// you have computed the gradient for the logistic regression without regularization.
dj_db, dj_dw = compute_gradient(X, y, w, b)

  1. you do not need the following anymore — since you are doing the computation all over again and adding it to the original one.

START CODE HERE

Moderator edit, code removed.

Do not post your code on the forum. That is not allowed by the Code of Conduct .