vendredi 17 avril 2020

Speeding up generation of large array of Gaussian numbers using numpy

I need to draw a large number of samples (30 million) from a Gaussian distribution. Using numpy, I use the following function call:

np.random(1.2, 1.5, (30, 100, 100, 100, 1))

Using timeit, I find that this takes 828 ms. Since my processor runs at 2.5 GHz, this roughly takes 6700 cycles per sample. I feel this is too high. Is there a way to speed this up? I am even ready to use some other library if needed. I have already checked that I am using MKL on an Intel processor.




Aucun commentaire:

Enregistrer un commentaire