KL-Divergence calculation between two matrices-- fast python implementation?

Viewed 171

I have two matrices A: (n x m), B: (l x m), and I want to calculate the KL divergence between every pair of rows between A and B resulting in a (n x l) matrix.

I know that scipy has an entropy function, but I can't figure out how to use it to extend and vectorize this calculation between matrices.

Any help is appreciated!

0 Answers
Related