I have investigated to solve this issue. I only could able to solve this problem with the help of official documents of the TensorFlow call() method:
Look at those required positional arguments query, key, value, and attention_mask and passed into self.mha(…).
I am easy to find the deal with the problem by look the diagram and figure it out how to input pass to the next layer
TMosh
December 1, 2022, 6:58am
2
Sorry, but I don’t quite understand if you are asking a question, and what exactly you need help with.
Oh sorry, it was a general post for helping folks tackle that exercise. Did I post the wrong place?
TMosh
December 1, 2022, 8:03am
4
That’s fine, I just wasn’t sure if you were asking a question.
how do we extract q,v,k and pass it in self.mha()
TMosh
December 1, 2022, 11:38pm
6
For self-attention, you use ‘x’ for all three of them.
That’s why there is one line coming up into the MHA box in Fig 2a, then it splits into three separate inputs. They’re all the same data.
I’ve submitted a support ticket to have the arrows in that figure labeled.
1 Like
i thought so too, so i tried that in the first place, i got this error
any suggestions on what might be wrong.
Thanks
TMosh
December 1, 2022, 11:52pm
8
Please post another image that shows the entire assert stack. The interesting errors tend to be in the top or middle, not the bottom.
i underlined the code where i got error
TMosh
December 2, 2022, 12:10am
10
Look at the function definition for self.mha(). It requires four arguments. You only provided two.
TMosh
December 2, 2022, 1:18am
12
You don’t have the correct arguments for self.mha().
I replied earlier to use ‘x’ for all three of K, Q, and V.
That means you put ‘x’ in the call arguments three times.
Hi TMosh,
Thank you for the support, i really appretiate it. i completed the assignment.
Thanks for letting me be part of this course