Live data from Hacker News

Jensen–Shannon Divergence

en.wikipedia.org

21–29 of 29 posts

Re: Jensen–Shannon Divergence

#23

There is so much I don't understand

Every time I end up on wikipedia page for some math or CS term I just give up on reading and search for other source, any at all. I know it is supposed to be an encyclopedia, and I am sure definitions are technically correct but it just isn't what most people need. I remember wikibooks project tried to bridge that gap but it never got popular enough. I guess it is just easier to compose short notes compared to writing full blown manual, and its much harder to split such work.

Re: Jensen–Shannon Divergence

#24

Why not use this instead of KL in reinforcement learning?

It's been used, along with every other divergence and distance you can think of.

In practice, which divergence you use doesn't seem to be very important. The KL is the one with the most theoretic foundation though, i.e. will work with infinite data. The important aspect seems to be that neural networks are Lipschitz bound, and that that is the most important constraint preventing collapse.

Re: Jensen–Shannon Divergence

#25
post #14

Why not use this instead of KL in reinforcement learning?

JSD is just symmetrized KL, it's the forward KL + reverse KL. In reinforcement learning, usually what we want is to find the optimal action, i.e. action that maximizes the reward, this translates to the so-called "mode-seeking" optimization, which is the reverse KL.

JSD is slightly different to forward KL + reverse KL (which is unbounded, whereas JSD measured in bits is in the range [0, 1]).

One way to interpret JSD(P, Q): Associate the distributions P and Q with two target classes, respectively. Pick a target class based on a fair coin flip. Then sample either from distribution P or distribution Q, depending on the outcome of the coin flip. The JSD is the mutual information between the resulting mixture distribution and the target class.

Alternative intuition: Suppose we want to measure the correlation between a feature X and a binary target class Y. We have a tabular data set with two columns X and Y, whose rows correspond to individual samples. JSD is the mutual information between the feature X and the target class Y, but after we resample our data (rows) to ensure that we have a balanced representation of the target class Y. If we measure the JSD in bits, the quantity 2^(JSD-1) is the fraction of times X correctly predicts Y, assuming balanced classes.

Re: Jensen–Shannon Divergence

#27

Why not use this instead of KL in reinforcement learning?

To minimise the KL you just calculate the surprisal. The integral can be approximated by sampling over your training data. It's a direct expression of the information loss between your real data and your fitted probability distribution.

Calculating the JSD could be more difficult, the expression uses a mixture between the 'true' and 'fitted' distribution. You can still simulate this, but half the time you'd be fitting the model to itself, and I just don't see why that would be useful.

I think the JSD is most useful when you need an actual metric, but as long as you have a fitted and target distribution the KL divergence is a natural fit since you can interpret the result as information loss.

Re: Jensen–Shannon Divergence

#29

There is so much I don't understand

Every time I end up on wikipedia page for some math or CS term I just give up on reading and search for other source, any at all. I know it is supposed to be an encyclopedia, and I am sure definitions are technically correct but it just isn't what most people need. I remember wikibooks project tried to bridge that gap but it never got popular enough. I guess it is just easier to compose short notes compared to writin…

I have found that asking an llm for an Eli 5 ( along with the important follow up questions ) usually works out
Post reply on HN