Memory and attention in deep learning