A deep learning approach for predicting spatiotemporal dynamics from sparsely observed data