Week 2 -Assignment #2 error with Embedding() Exercise 4

I am on excersise 4 and got the following error: “AssertionError: Wrong vaulues”. I am not sure if I put the embedding() correct. Did i do this right?

{moderator edit - solution code removed}

If the assertion fails, then it’s pretty good bet that there is something wrong with your code.

A few points here:

  1. You filed this under Week 2 of NLP C1, but I think you mean Week 4. I moved it for you using the little “edit pencil” on the title.
  2. It’s against the rules to just post your code and say, in effect, “Please fix it for me”.
  3. I haven’t actually gotten to this exercise yet, but just looking at the code on general principles, it looks pretty suspect:

Think about what the “embedding matrix” represents or just look at the shape of it: the second dimension of it is an “embedding vector”, right? But you’re setting it to a scalar “index” value. That doesn’t seem correct to me. But this is with the disclaimer that I have not actually done this exercise myself.