Hello - any suggestions on correct syntax for list comprehension(?) to address error below
—> 54 single_example_ix = char_to_ix[[single_example_chars]]
55 X = [None] + single_example_ix
56
TypeError: unhashable type: ‘list’
(sorry but having little experience with Python i struggle with syntax:-(
Hello, I notice the grader passed me on Week 1 : Course 5 : Sequence Models, even though I did not get the required output for the final section.
Although my Python knowledge is slight, I would still like to learn why my code in the ‘model’ section was off. Since I cant post on Discourse, I paste it below, along with the (wrong) output which seems not to converge at all.
Any tips inputs to help me understand apprecated.
{mentor edit: image of code removed - not allowed by the Honor Code}
I think the main problem is in your single_example_ix code.
For each character in single_example_chars, you want to look it up in the char_to_ix dictionary.
So…
single_example_ix = [char_to_ix[c] for c in single_example_chars]