Cortical Microcircuits from a Generative Vision Model