Hi, my output sampled indices does not match the expected output (only the first 4 indices are correct), can you provide some hints what is wrong in my implementation? Thanks.
Here is my output:
Sampling:
list of sampled indices:
[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]
list of sampled characters:
[‘w’, ‘p’, ‘z’, ‘z’, ‘s’, ‘y’, ‘d’, ‘a’, ‘o’, ‘f’, ‘d’, ‘y’, ‘w’, ‘w’, ‘j’, ‘n’, ‘p’, ‘l’, ‘k’, ‘c’, ‘t’, ‘p’, ‘v’, ‘w’, ‘n’, ‘o’, ‘f’, ‘i’, ‘z’, ‘b’, ‘f’, ‘a’, ‘z’, ‘k’, ‘b’, ‘u’, ‘\n’]
AssertionError Traceback (most recent call last)
in
19 print("\033[92mAll tests passed!")
20
—> 21 sample_test(sample)
in sample_test(target)
15 assert indices[-1] == char_to_ix[’\n’], “All samples must end with \n”
16 assert min(indices) >= 0 and max(indices) < len(char_to_ix), f"Sampled indexes must be between 0 and len(char_to_ix)={len(char_to_ix)}"
—> 17 assert np.allclose(indices[0:6], [23, 16, 26, 26, 24, 3]), “Wrong values”
18
19 print("\033[92mAll tests passed!")
AssertionError: Wrong values
Expected output
Sampling:
list of sampled indices:
[23, 16, 26, 26, 24, 3, 21, 1, 7, 24, 15, 3, 25, 20, 6, 13, 10, 8, 20, 12, 2, 0]
list of sampled characters:
[‘w’, ‘p’, ‘z’, ‘z’, ‘x’, ‘c’, ‘u’, ‘a’, ‘g’, ‘x’, ‘o’, ‘c’, ‘y’, ‘t’, ‘f’, ‘m’, ‘j’, ‘h’, ‘t’, ‘l’, ‘b’, ‘\n’]