I have set out to gain some insights into the active inference theory that provides a unified framework for perception, learning, decision making, and action. I will share my “lecture notes” combined with my own comments in this and future posts. My focus is on the mathematical models and the necessary algorithms.