mardi 7 juin 2016

Lua random seed

I have a python program which I am trying to replicate in lua. In the python code, I have created a number of random matrices and have initially set the random seed using np.random.seed(seed=1). To make it easier to debug and trace the output of my lua program, I would like to set the same random seed in my lua code also. Is this possible and if so, how?

In lua, I have tried:

math.randomseed(1)

Then, I set a=torch.rand(2,2) and printed a but different matrices are being printed when I print a




Aucun commentaire:

Enregistrer un commentaire