Because your code is incorrect. Please double-check your code with instructions and hints. If still facing any issue, send me your code in a direct message. Click my name and message.
One common error on this section is to use the wrong PRNG function. Note that in all cases up to this point weâve used ârandnâ, which is a normal distribution. But here we need the uniform distribution on [0,1]. That is ârandâ instead of ârandnâ.
Also check that you included the âinverse dropoutâ compensation by multiplying by 1/keep_prob
.
Thank you @Max2001 for sending me your code.
As Paul mentioned, you have used ârandâ but the shape is incorrect. Please reread the instructions.
Thank you so much!!! I didnât notice that!
Yes, itâs an interesting point in how Prof Ng has us implement DropOut that in each minibatch every sample is handled differently w.r.t. the dropout mask. This was not clear from the lectures (or at least I donât remember him discussing this point), but itâs very clear in the instructions in the assignment here. There has been some interesting previous discussion of this point, which is worth a look. That thread even includes some experiments with doing it both ways (same per sample or different per sample).