Making Memory Think for Deep Learning