The Attention Mechanism from Scratch