Variational Inference

What do Variational Autoencoders (VAEs), Diffusion Models behind generative AI and fuzzy clustering have in common? The answer lies in a single, elegant framework for fitting probability distributions to data.
We’ll show how to fit complex data with a mixture model. We’ll be using an energy-based formulation, drawing surprising analogies from thermodynamics. Discover the variational inequalities that form the mathematical backbone of these diverse methods, from the classic Expectation-Maximization algorithm to the cutting-edge models that generate stunning images from noise.


Compounding is for the Mathematically Illiterate

You’ve been calculating percentages all wrong! 😃
Why doesn’t a 50% gain followed by a 50% loss get you back to your starting point? Because the standard way we define percentage increases is needlessly complicated. This post introduces the “true increase”, a new definition based on exponentials that makes growth calculations intuitive: percentages simply add up. A 10% gain and a 20% gain is exactly a 30% gain.
You will see how this change of perspective makes compounding obsolete and simplifies everything from interest rates to the “rule of 70”.


Blackbody Thermodynamics

Plancks law for black body radiation explains the color of a glowing hot object, the light from our sun, and even the energy radiated by the Earth. This post offers a complete derivation of that famous equation for black body radiation, starting from the foundational principles of thermodynamics. We build the formula from the ground up, relying on just a few clearly stated postulates. You will see how a profound physical result emerges from a surprisingly simple and direct thermodynamical approach.


Heuristics for Monad Rules

Where do Haskell constructs such as the State, List, and Continuation monad really come from? This post explains the idea of a “functor adjunctions,” starting with a simple duality relation to show how the core properties of a monad naturally emerge. This reveals a mathematical blueprint that unifies some apparently very different concepts.