Compute and display gradient with w initialized to zeroes
initial_w = np.zeros(n)
initial_b = 0.
dj_db, dj_dw = compute_gradient(X_train, y_train, initial_w, initial_b)
print(f’dj_db at initial w (zeros):{dj_db}’ )
print(f’dj_dw at initial w (zeros):{dj_dw.tolist()}’ )
I get these results:
dj_db at initial w (zeros): [-0.12009217 -0.11262842]
dj_dw at initial w (zeros): [-12.00921658929115, -11.262842205513591]
Whereas the expect output is
dj_db at initial w (zeros) -0.1
ddj_dw at initial w (zeros): [-12.00921658929115, -11.262842205513591|
And that seems to be producing errors when I run the next cell for cost and gradient with non-zero w.