Hello there,
I have an issue with this exercise. My code gets only first 4 indexes right
[23, 16, 26, 26, 19, 25, 4, 1, 15, 6, 4, 25, 23, 23, 10, 14, 16, 12, 11, 3, 20, 16, 22, 23, 14, 15, 6, 9, 26, 2, 6, 1, 26, 11, 2, 21, 0]
instead of
[23, 16, 26, 26, 24, 3, 21, 1, 7, 24, 15, 3, 25, 20, 6, 13, 10, 8, 20, 12, 2, 0]
It also appears to output more indexes that expected.
Trying to debug this code, I want to verify if my assumptions are correct:
- x is vector of the same size as the dictionary - 27
- y is of the shape (27, 100)
- each of 100 entries add up to 1, which I understand is a probability for each of 100 characters in the word
- the input to np.random.choice is a vector of length 27. If I pass all 100 vectors at once I get an error that probabilities do not add up to 1. How do I chose which of 100 vectors goes to np.random.choice function? I tried using idx and counter.
- In step 4 why do we have x = None and x[idx] = None. Isn’t x should be set to y? Looking at the Figure 3 x<t+1> is y. So why do we want to update particular element in the vector and what it should be set to? I tried setting it to idx but then I only get one index right.
Thank you,
Alex