On the use of deep learning for phase recovery