The theory of attention within neural networks