Supervised, unsupervised and semi-supervised learning, Bayesian learning, Energy minimization and optimization