bessagroup / f3dasm

Framework for Data-Driven Design & Analysis of Structures & Materials (F3DASM)
https://f3dasm.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
111 stars 29 forks source link

Parallel data generation: Unexpected behavior of Numpy random generator seed #247

Open BernardoFerreira opened 8 months ago

BernardoFerreira commented 8 months ago

Problem: When using the 'parallel' option to generate data with f3dasm, i.e.,

experiment_data.evaluate(data_generator=my_generator, mode='parallel')

it seems that the numpy random seed is NOT being randomized in each parallel process as expected (getting the same outcome of numpy random processes in all parallel jobs!).

Potential solution: Reseed NumPy random generator in DataGenerator class methods with np.random.seed().