Perceptual Inference: A Matter of Predictions and Errors