[Numpy-discussion] Efficient square distance computation

Henry Gomersall heng at cantab.net
Tue Oct 8 05:55:58 EDT 2013


On 08/10/13 09:06, Ke Sun wrote:
> I give as input a 70,000x800 matrix. The output should be a 70,000x70,000
> matrix. The program runs really slow (16 hours for 1/3 progress). And it eats
> 36G memory (fortunately I have enough).

At this stage I'd be asking myself what I'm trying to achieve and why 
I'm trying to explicitly calculate every element of a 70,000x70,000 
matrix and how I might do it otherwise.

Most optimisations when it comes to things like this make use of the 
structure of the matrix and knowledge of the algorithm in which it fits.

Cheers,

Henry



More information about the NumPy-Discussion mailing list