mardi 2 février 2021

Producing same random matrix everytime in numpy across different machines

I have a compression algorithm running on a RPi that uses random normal matrices over its life with dimensions being (x, N) where 1 <= x <= N-1 and both x, N could change. Now, every-time a compressed packet is sent to the server, the server needs to know the random matrix that was used by the RPi to be able to reconstruct the data. I can't afford transmitting the matrix every-time and also can't memoize all the possible arrays that might be required. So basically, I need to be able to construct the (x, N) random array at both the machines. How can I do this?

  • I have tried using the same numpy versions and seeds on both the machines, that does the job partially but the problem is that it will produce the same random arrays at both the machines only if the number of times any function from the random library called remains same at all times.

  • It will be great if someone can refer me to a function that can output a standard normal matrix of any dimension with the output of a particular dimension being fixed at all times.




Aucun commentaire:

Enregistrer un commentaire