如何计算矩阵的以 2 为底的对数?

How to calculate the base 2 log of a matrix?

我发现计算矩阵对数而不是矩阵每个分量的对数的唯一函数是 scipy 的 logm() 函数,但它找到的对数具有底数e, 我需要base 2 log.

您可以使用换底公式转换对数的底数:

log2(x) = logm(x) / logm(2)

Mathematica StackExchange 对此背后的数学进行了更深入的讨论:

https://mathematica.stackexchange.com/a/92293