we are supposed to find a way to multiply a 2D array X of size (7403, 33) with its transpose
i mean this X* X.T
The solution is supposed to be 2.5 times faster than the np.dot(X,X.T). i have tried everything i can think of
%timeit np.dot(X,X.T)
%timeit np.matmul(X,X.T)
%timeit [email protected]
%timeit np.einsum("ij, jk -> ik",X,X.T)
and i have only acheived 1.5 times faster than the numpy dot
3.17 s ± 14.9 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
2.03 s ± 6.82 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
2.01 s ± 6.57 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
2.02 s ± 6.67 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
timeitresults suggest that the last 3 call the same procedure. Why do you need it to be faster?