This post is the third and final post in our series on quadcopter simulation. The first post and second post derived and simulated the quadcopter’s equations of motion, first in 2D and then in 3D. In this post we train a reinforcement learning policy to fly the quadcopter, first to hover at a fixed point, then to fly through a sequence of gates. The previous posts were tutorial-like, we started…
This post is the second post in our series on quadcopter simulation. If you want the simpler planar version first, the previous post derives and simulates the same ideas in 2D, but this post is fully standalone. Today, we simulate a three-dimensional quadcopter. We will derive the equations of motion, transform them into state-space form, and finally simulate the system in Python. Along the way,…
In this post, we build a simple simulation of a 2D (planar) quadcopter, a type of drone with four propellers. We will derive the equations of motion, rewrite them in state-space form, and simulate the resulting system in Python. Why simulate a quadcopter at all? If you want to design a controller, or train a reinforcement learning agent, you first need a model you can run in software. This post…
In this post we will get our hands dirty and use the concepts we learned in “What is the ELBO in Variational Inference?” to perform variational inference for a 1D distribution.
Bayesian Inference The three main objects of Bayesian inference In Bayesian Inference, there are three main objects we want to study: The distribution of observations \(y \sim Y\). Under the Bayesian framework, we believe that the observed data is sampled from a probability distribution. For example, if we measure the height of every person in a group of people, we could assume that the…
Full code available at github.com/mrandri19/smolppl/tree/sampling Introduction This post is the continuation of “A probabilistic programming language in 70 lines of Python” . Today, we extend the library built in the last post by creating an API for sampling values from the prior and posterior distributions. At the end we will have build an API like this one: x = LatentVariable ( "x" , Normal , […
Full code available at github.com/mrandri19/smolppl The continuation to this post, called “Predictive sampling and graph traversals” is now available! Introduction In this post I will explain how Probabilistic Programming Languages (PPLs) work by showing step-by-step how to build a simple one in Python. I expect the reader to be moderately familiar with PPLs and Bayesian statistics, as well as…
Target Reader/Required Knowledge This post is an introduction to conjugate priors in the context of linear regression. Conjugate priors are a technique from Bayesian statistics/machine learning. The reader is expected to have some basic knowledge of Bayes’ theorem, basic probability (conditional probability and chain rule), machine learning and a pinch of matrix algebra. In addition the code will…