Bayesian learning for control in multimodal dynamical systems