You need a symmetric score that stays finite when the two supports differ. What's the standard choice?
The Jensen-Shannon divergence is at most ln 2 nats, reached when the two distributions don't overlap at all. Level 1 of the practice problem asks for it too.
In the editor, write js_divergence(p, q) from the midpoint. It prints the sizes against a uniform model, then two distributions that never overlap.
Pick an answer above to see the rest
Instructions
1
Write js_divergence(p, q): with m the average of p and q, return half of KL(p ‖ m) plus half of KL(q ‖ m).
2
kl_divergence from the first task is already there.