Free Energy Minimization: A Unified Framework for Modeling, Inference, Learning, and Optimization [Lecture Notes]