Canonical cortical circuits and the duality of Bayesian inference and optimal control. (October 2021)