Reconstruction of sequential data with density models