The impact of memory on learning sequence-to-sequence tasks