Perception as bayesian inference