Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.2, 1.3
-
TVB 1.3-6899 on the cluster
-
1.3.2 - admins
Description
I launched some PSEs using different matrices, but the rest of that parameters were the same, however the coupling strength was set to 0. The PSE plots should have been identical. They weren't.
The guilty was the seed used for setting the initial conditions.
The method truncated_white in noise.py is currently not using the seed set through the interface.
This methods uses the function truncnorm from scipy. So far, it is not possible to use a RandomState object with certain scipy functions. So we cannot do self.random_stream.truncnorm .... as it is done with the functions used in 'coloured' and 'white'.
Using RandomState objects is the advised way to create streams of random
numbers. Scipy functions like truncnorm depend on numpy.random and the only way to set the seed to get identical results is by doing
numpy.random.seed(my_seed) ... some python developers are against it but it's the way suggested in the scipy documentation ...
A way to fix the problem then is adding the following line in 'truncated_white'
- This is basically getting the 'init_seed' of the corresponding random_stream
numpy.random.seed(self.random_stream.get_state()[1][0])
before calling scipy_stats.truncnorm
The streams of random numbers used by the integrators are ok because they are not calling truncated_white.
Gliffy Diagrams
Attachments
Issue Links
- blocks
-
TVB-1041 Noise stream is not properly given to set the initial conditions
-
- Closed
-