It looks like there is a pretty consistent pattern there: literally all of your
DA_prev values are zero, in both the max and avg pooling cases. But you can see that the expected values in both cases are not all zeros. How could that happen? What is on the RHS of the assignment statement that ends up getting assigned to one of the target patches in
DA_prev? Have you checked to see if that ever becomes non-zero?
If you succeeded at the
conv_forward case for back prop, congrats! The basic structure of the logic in terms of the loops for
pool_forward is the same, other than the fact that the pooling works “per layer”. But the real difference in the pooling case is the way the values get distributed by the mask routine in the “max” case or by the “distribute” function in the average case.