Difference between revisions of "Numpy linalg"
Jump to navigation
Jump to search
(→Einsum) |
(→Einsum) |
||
Line 35: | Line 35: | ||
print np.dot(a, a) | print np.dot(a, a) | ||
</source> | </source> | ||
+ | |||
+ | === Ellipsis broadcasting in numpy.einsum === |
Revision as of 12:01, 19 June 2014
Contents
How to transpose higher dimension arrays
http://jameshensman.wordpress.com/2010/06/14/multiple-matrix-multiplication-in-numpy/
Faster dot product using BLAS
http://www.huyng.com/posts/faster-numpy-dot-product/
http://stackoverflow.com/questions/5990577/speeding-up-numpy-dot
http://wiki.scipy.org/PerformanceTips
http://thread.gmane.org/gmane.comp.python.numeric.general/28135/
Multi dot
http://wiki.scipy.org/Cookbook/MultiDot
Einsum
http://chintaksheth.wordpress.com/2013/07/31/numpy-the-tricks-of-the-trade-part-ii/
a = np.arange(4).reshape(2,2)
print a
print "np.einsum('ii', a), row i multiplied downwards"
print np.einsum('ii', a)
print "np.einsum('ij', a), same matrix ?"
print np.einsum('ij', a)
print "np.einsum('ji', a), transpose"
print np.einsum('ji', a)
print "np.einsum('ij,jk', a, a), dot product"
print np.einsum('ij,jk', a, a)
print np.dot(a, a)