Course5, Week1, Assignment2, Exercise3 - Problems in the clip function call

Hi! I’ve failed to overcome the following error just after the optimize function:

“AssertionError: Problems in the clip function call”

Up to this point everything seems fine, and even following the optimize_test, all expected values are achieved precisely. Could you please advise me a solution?

1 Like

If you look further at the code for the asserts, it says this:
assert np.min(grad) >= -5, “Problems in the clip function call”
assert np.max(grad) <= 5, “Problems in the clip function call”

The “grad” values come from the gradients returned by your optimize() function.

These asserts are thrown if your optimize() function gets bad results when it calls the clip() function.

Things to check:

  • is your optimize() function correctly calling your clip() function?
  • does your clip() function work correctly?

I saw the same situation. Any solution now?
It seems that da_next in gradients in the optimize function while this is not accounted in clip function.

I recommed you start a new thread. This thread is 3 years cold, and another mentor will be able to find your question more easily.

What is the error message that you get? Did you investigate the points that Tom made in his earlier reply on this thread?

Of course Tom is right that starting a new thread would be a good idea.