mardi 22 janvier 2019

Fastest way to sample from multidimensional random normal in python

At each iteration of a for loop, I would like to get a batch of samples from a multidimensional random normal distribution in python. What is the most efficient function to use when running the script on CPUs and GPUs? From my experiments so far it seems that tensorflow's tf.random.normal seem to be the fastest option. Pytorch's MultivariateNormal seems to be too slow. Ideally I would like to integrate it with a pytorch nn (so cast the samples to pytorch tensors after generation).




Aucun commentaire:

Enregistrer un commentaire