Week #4 deep-learning-specialization:dls-course-1
Hello everyone,
I’m currently working on a deep learning assignment and have hit a roadblock that I’m struggling to overcome. I’m trying to implement the backpropagation algorithm for a deep neural network, but I keep encountering an IndexError
when running my code.
The error message states: IndexError: boolean index did not match indexed array along dimension 0; dimension is 3 but corresponding boolean dimension is 1
I’ve attached screenshots of my Jupyter notebook where the error occurs. The issue arises when I attempt to run the L_model_backward
function, which is supposed to compute the gradients for backpropagation.
I’ve reviewed the dimensions of the arrays and the indexing, but the error persists, and I’m not sure how to proceed. I would be very grateful for any guidance on how to debug this issue. I suspect the problem might be with how I’m indexing into the arrays or maybe a misunderstanding of how the backpropagation should be implemented.
If anyone has experienced a similar issue or has insights into how I might resolve this, your input would be highly appreciated!
Thank you in advance for your assistance!
Best,
Kim
{moderator edit - solution code removed}