Hello guys,
I need some help with the following problem in:
Function sample(parameters, char_to_ix, seed):
I believe the issue is here:
I used these 2:
idx = np.random.choice(range(len(y.ravel())), p = y.ravel())
idx = np.random.choice(list(range(vocab_size)), p = y.ravel())
I get
Sampling:
list of sampled indices:
[23, 16, 26, 26, 24]
list of sampled characters:
[‘h’, ‘p’, ‘i’, ‘i’, ‘\n’]
But the error says
ValueError: operands could not be broadcast together with shapes (5,) (6,), which is related to
assert np.allclose(indices[0:6], [23, 16, 26, 26, 24, 3]), “Wrong values”
It makes sense because my result is (5,) but the assert is (6,). Why I get this difference?