I was studying this link and this is the code .
U1 = np.random.rand(*H1.shape) < p # first dropout mask
Why does it fail when I try to do this?
import numpy
numpy.random.rand(*1) < 2
I understand that the rand()
function takes in a number which is why I am confused that the code is supposed to work.