The brain has to solve inverse problems to correctly interpret sensory data and infer the set of causes that generated the sensory inputs. Such a problem is typically ill-posed, and thus requires constraint the narrow down the number of solutions. Predictive coding (PC)is a computational neuroscience framework that finds the most likely causes for the sensory input by minimizing the mismatch between the sensory data and the predicted input. Such a framework could be used to build sparse hierarchical internal representations of a given input.