问题
The only function that I found that calculates the log of the matrix, and not of each component of the matrix, was scipy's logm() function, but it finds the log with base e, I need the base 2 log.
回答1:
You can use the change-of-base formula to convert the base of the logarithm:
log2(x) = logm(x) / logm(2)
Mathematica StackExchange has some more in depth discussion of the math behind this:
https://mathematica.stackexchange.com/a/92293
来源:https://stackoverflow.com/questions/54773370/how-to-calculate-the-base-2-log-of-a-matrix