The role of attention in learning simple visual tasks