Atcold / pytorch-PPUU

Code for Prediction and Planning Under Uncertainty (PPUU)
https://youtu.be/X2s7gy3wIYw
MIT License
203 stars 54 forks source link

Dataloader messes with numpy seed #32

Closed Atcold closed 5 years ago

Atcold commented 5 years ago

https://github.com/Atcold/pytorch-PPUU/blob/master/dataloader.py#L91-L92

# Inside an else-statement
numpy.random.seed(0)
perm = numpy.random.permutation(self.n_episodes)

should be instead

rng = np.random.RandomState(0)
rng.permutation(self.n_episodes)

Otherwise dataloader will change stuff conditionally... Need to verify consistency, though.