Hey,
I’m getting an error in the sampling function as follows;
ValueError Traceback (most recent call last)
<ipython-input-40-a13d660e654a> in <module>
19 print("\033[92mAll tests passed!")
20
---> 21 sample_test(sample)
<ipython-input-40-a13d660e654a> in sample_test(target)
7
8
----> 9 indices = target(parameters, char_to_ix, 0)
10 print("Sampling:")
11 print("list of sampled indices:\n", indices)
<ipython-input-39-69920f8c406b> in sample(parameters, char_to_ix, seed)
56 # Step 3: Sample the index of a character within the vocabulary from the probability distribution y
57 # (see additional hints above)
---> 58 idx = np.random.choice(range(len(y.ravel())), p= y.ravel())
59
60 # Append the index to "indices"
mtrand.pyx in numpy.random.mtrand.RandomState.choice()
ValueError: probabilities do not sum to 1
Any help is appreciated. Thank you.