Dinosaur Island -- confused about sampling step 3

I think I understand the basic idea about how to use the np.random.choice function on the probabilities returned from the y<t+1> calculation, but I am confused by the shape of y which is (27, 100)… all of the columns of y seem to be the same and seem to be the softmax probability distributions, but when I select one column and run it through the loop, I get the wrong sequence.

The first thing to investigate is whether your y shape is correct. I added some print statements to my code, so that I could see what was happening, and here’s what I see when I run the test cell for sample:

vocab_size = 27
Wax (100, 27) dot (27, 1) + Waa (100, 100) dot a_prev (100, 1)
Wya (27, 100) dot (100, 1) + by (27, 1)
y.shape (27, 1)
len(y) 27

Hmmmmm. :nerd_face:

1 Like

That shape stuff and the use of np.zeros, etc. is crazy. I remember Professor Ng mentioning on a number of occasions about shape issues. :wink:. Thank you.

1 Like