Unit test output:
All tests passed for n_gram_seqs!
Details of failed tests for pad_seqs
Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
operands could not be broadcast together with shapes (5,6) (5,5) .
All tests passed for features_and_labels!
All tests passed for create_model!
My output:
array([[ 0, 0, 0, 0, 34, 417],
[ 0, 0, 0, 34, 417, 877],
[ 0, 0, 34, 417, 877, 166],
[ 0, 34, 417, 877, 166, 213],
[ 34, 417, 877, 166, 213, 517]], dtype=int32)
Expected output:
array([[ 0, 0, 0, 34, 417],
[ 0, 0, 34, 417, 877],
[ 0, 34, 417, 877, 166],
[ 34, 417, 877, 166, 213],
[417, 877, 166, 213, 517]], dtype=int32)
Note that in the expected case, the first element (34) is missing from the last list, i.e., the padding removes the first element, for the last sequence. In my output, the last sequence still has 34 as the first element.
My output for features_and_labels() is also different, in the same way (although my implementation of features_and_labels() passed the unit test):
My output:
labels have shape: (5, 3211)
features look like this:
array([[ 0, 0, 0, 0, 34],
[ 0, 0, 0, 34, 417],
[ 0, 0, 34, 417, 877],
[ 0, 34, 417, 877, 166],
[ 34, 417, 877, 166, 213]], dtype=int32)
Expected Output:
labels have shape: (5, 3211)
features look like this:
array([[ 0, 0, 0, 34],
[ 0, 0, 34, 417],
[ 0, 34, 417, 877],
[ 34, 417, 877, 166],
[417, 877, 166, 213]], dtype=int32)
Note again that the expected output is missing 34 on the last line, but I still have it.
I’d appreciate help with this. Thank you!