The code runs ok without warning/error.
The expected output is wrong. Also the loss is extremely small compared with expected output.
Could you help?
One common mistake on this function is to use the alphabetical corpus that they give you as a parameter as the input, instead of using the “scrambled” version that they create for you in the template code. But the incorrect values you get do not look like what happens if you make the mistake that I just described. But something is amiss in your code, now we just need to figure out what it is.
Just for reference, here’s a thread which shows the incorrect answer in the “alphabetical” case.
To close the loop on the public thread, there was a bug in the model
code. The logic that used “modulo” to prevent the loop from indexing off the end of the list of examples was incorrect and was using a much smaller threshold.