TensorDiffEq icon indicating copy to clipboard operation
TensorDiffEq copied to clipboard

Reproducibility

Open emiliocoutinho opened this issue 3 years ago • 3 comments

Dear @levimcclenny,

Have you considered in adapt TensorDiffEq to be deterministic? In the way the code is implemented, we can find two sources of randomness:

  • The function Domain.generate_collocation_points has a random number generation
  • The TensorFlow training procedure (weights initialization and possibility of the use o random batches)

Both sources of randomness can be solved with not much effort. We can define a random state for the first one that can be passed to the function Domain.generate_collocation_points. For the second, we can use the implementation provided on Framework Determinism. I have used the procedures suggested by this code, and the results of TensorFlow are always reproducible (CPU or GPU, serial or distributed).

If you want, I can implement these two features.

Best Regards

emiliocoutinho avatar Jun 10 '21 22:06 emiliocoutinho

@emiliocoutinho was this still something you were interested in?

levimcclenny avatar Nov 17 '21 06:11 levimcclenny

@emiliocoutinho was this still something you were interested in?

Yes, @levimcclenny. I already have this implemented in my code. If you want, I can add this here as well.

emiliocoutinho avatar Nov 17 '21 18:11 emiliocoutinho

I'll be interested to apply this in my code as well. Any suggestions? Thanks!

ShaikhaTheGreen avatar Mar 04 '22 14:03 ShaikhaTheGreen