8/13
Part 6 of 7 · The worked exampleLearn and do

A worked example: KL for continuous distributions, out loud

Here's the OpenAI question, worked out loud.

Implement KL divergence for continuous distributions. The report is one line (1 source), and it leaves the inputs open, so ask.

1. Ask what you're given. Two named families, like normals? Two density functions you can evaluate? Samples from p only? Samples from both?

Predict

The interviewer says: two density functions of one variable, no formula. What's your first move?

Pick an answer above to see the rest
Predict

You only have samples of p and q. You bin both into histograms and compute the discrete KL. What can go wrong?

Pick an answer above to see the rest