This paper identifies connections between predictive coding, from theoretical neuroscience, and variational autoencoders, from machine learning. These connections imply striking correspondences for biological neural circuits, suggesting that pyramidal dendrites are functionally analogous to non-linear deep networks and lateral inhibition is functionally analogous to normalizing flows. Connecting these areas provides new directions for further investigations.