I am getting “AssertionError: Wrong values case 1” error for this assignment.
I passed the UNQ_C4 assignment.
I applied the square root of the embedding dimension, self.pos_encoding [:, :seq_len, :] and training for dropout.
There is nothing to code aside from these.
Hey @Hasan_Resul_Cesur,
Welcome to the community. It’s hard to find the exact issue without taking an exact look at your code for the Encoder class. Additionally, it might be possible that your first 4 functions have passed the test cases, but still might have an error. A common issue could be to use the global variables inside the functions at places where they are not intended to, or to hard-code some variables to pass the corresponding test cases.
Can you please DM me your code so that I can find the exact issue? Make sure to not post it publicly since it is strictly against the community guidelines. Just click on my name, and select “Message”.
I found the problem.
“self.enc_layers” definition inside the “init” part is a list comprehension. I thought it’s a fixed size list. So the problem was with the indexing while using “self.enc_layers” later on.
Thank you @Elemento for your consideration and help.
I’m stumped with this one. I’m trying to use i to index through x but clearly that is not right. I picked up on the tip that self.enc_layers are a ListWrapper and that we’d be using the objects inside the list inside the wrapper. I’m trying to understand what you mean by the problem being with 'the indexing while using self.enc_layers later on '.
Another post also suggested looking at the Enconder_test function in public tests for clues but I haven’t been able to see the pattern.
Indexing through ‘x’ is not correct.
Use ‘i’ to index through the layers via self.enc_layers[i](...), where you keep overwriting the ‘x’ value after you pass it to the Encoder layer.
Thanks TMosh, I found out my mistake was during scale embedding by multiplying it by the square root of the embedding dimension. I was repeating the multiplication and ignoring *=. I misspoke but I meant exactly what you wrote for slicing through self.enc_layers using i.