Gradient check: cannot cast nested dictionary of gradients to a large gradient vector

Hi,

I have tried many methods for this question. It seems that in # GRADED FUNCTION: gradient_check_n, the gradients parameter is passed as a nested dictionary. I cannot find an easy way to convert it to a nested array that matches gradapprox.

Can someone help?

OK. I found out there is already a function called gradients_to_vector. Still the results are not correct, can somebody have a look?

Sure. Please click my name and message your notebook as an attachment.

1 Like

Hi, I already found the problem. I didn’t notice there is a function that is already implemented and then I sort it out. Thank you for your help anyway.