BERT's input must tell the model three things at once: which word it is, which sentence segment it belongs to, and where it sits in the sequence. The paper gives each its own learned table, and the three vectors are added together.
Implement bert_input_embedding, which looks up token, segment and position vectors and returns their element-wise sum for each position.
T rows of the position table.Index each table with the matching ids, slice the position table to length T, and add the three arrays.
No results yet
Run your code to check it against the examples, or submit to run every test.