Optimal GPU Memory for Deep Learning