python - vectorized matrix power and matrix dot using numpy -
i want calculate power of many 2-d matrices, , fast possible. couldn't find vectorized method it.
for example:
import numpy np mat_list = [np.mat(np.random.randn(100,100)) in range(1000)] output = [np.linalg.matrix_power(mat_list[i], 100) in xrange(len(mat_list))]
i same dot multiplications:
import numpy np mat_list1 = [np.mat(np.random.randn(100,100)) in range(1000)] mat_list2 = [np.mat(np.random.randn(100,100)) in range(1000)] output = [np.dot(a,b) a,b in zip(mat_list1,mat_list2)]
Comments
Post a Comment