Move the prediction closer to the target and compare the numbers.
target = 4
prediction = 7
print(abs(target - prediction)) Line notes
- Set the known target value.
- Set one prediction.
- Print the distance from the prediction to the target.
Question 5 of 5
One request takes two tokens and another takes three. The program sends them together and adds a filler position to the shorter row.
Put two phrases in a table to process them together. One has three words and the other has five. Add two placeholder cells to the short row. The rows now have the same length, but the placeholders say nothing about the sentence. A mask marks those positions so the model can skip them when computing attention.
WHERE TO START
Two phrases have different lengths. Which positions would you add to make them equal?
Move the prediction closer to the target and compare the numbers.
target = 4
prediction = 7
print(abs(target - prediction))