Why not f_wb[i] instead of f_wb

Please have a look at the following code.

    ### START CODE HERE ###
    # mentor edit: code removed
    ### END CODE HERE ### 

I had written f_wb[i], not f_wb. Then, I noticed in the hints section they had written f_wb. Why is it not f_wb[i]. I am writing f_wb[i] because I think it should iterate through nth example. Even original formula states f_wb(x[i]).
Similarly I had written cost[i] instead of just cost.

First of all you shouldnt publish in public code solutions!

Now, f_wb is it an array or just an int variable? You dont really need to keep the past values, so you just update these variables as you move along! Thats why.

1 Like

For sure.
Thank you.
Sorry, I didn’t notice I uploaded the solution. I would be careful next time.

1 Like