Edit: There is definitely something strange going on with this question. I just confirmed that we need to feed num_iterations variable from model function to the optimize function (that is 100% the case). Meaning this question is bugged
Hi, I’m doing exercise 8 and can’t seem to get my optimized d[‘w’] values to match the expected values.
I did notice something unusual though.
In the method definition written by the course num_iterations is set to 2000.
def model(X_train, Y_train, X_test, Y_test, num_iterations=2000, learning_rate=0.5, print_cost=False):
The issue is when I feed that to the optimize function that function appends every 100th cost calculation to a list. Then the grader checks my cost calculations and compares the length of that list expecting a list of length 1. But with 2000 iterations the length would have to be 20.
In either case I cannot manage to produce the expected values for d[‘w’]
All my other assignments questions are passing until question 8
Here is my code for the model function
w, b = initialize_with_zeros(X_train.shape[0])
params, grads, costs = optimize(w, b, X_train, Y_train, num_iterations=2000, learning_rate=0.5, print_cost=False)
w, b = params.values()
Y_prediction_test = predict(w, b, X_test)
Y_prediction_train = predict(w, b, X_train)