Course 1 Week Problem 6 - optimize

Problem with 6 - Optimize

I​ receive the following error:

AssertionError: Wrong values for costs. [array(5.80154532), array(0.09466104)] != [5.80154532, 0.31057104]

I​’m confused on two points: - it appears to have calculated cost correctly at first and then got an incorrect number later - why does the word "array’ appear

Welcome @wsverdlik! It looks like you are in Week 2 (W2). Since this is your first post, a helpful reminder to be specific about the precise location of concern. Thanks!

Note that the cost that you compute is is 2-dimensional. The actual cost is real-valued, i.e. a scalar. So first, make sure that the prior function, propagate, passes with a scalar value. It seems that you have done this. The propagate function actually reports the cost as a 1x1 ndarray. If you want, you could check this by inserting a notebook cell directly below the propagate function with the test data from the previous cell, and also report the cost:

If all of this looks good, then I will pass you along to this previous thread in response to a similar (if not the exact) issue.