Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducibility - Fix random seed on bsb #759

Open
drodarie opened this issue Oct 31, 2023 · 1 comment
Open

Reproducibility - Fix random seed on bsb #759

drodarie opened this issue Oct 31, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request priority.high

Comments

@drodarie
Copy link
Contributor

In order to be able to guarantee reproducibility of reconstruction and/or specific bug, as a user, I would like to be able to set a random seed to bsb. All reconstruction steps are concerned.

@drodarie drodarie added the enhancement New feature or request label Oct 31, 2023
@Helveg
Copy link
Contributor

Helveg commented Dec 15, 2023

This will require a technical proposal to address RNG in the framework.

I propose:

  • A new root dict rng which can contain RandomGeneratorNodes
  • Each RandomGeneratorNode should provide an init_rng method that initializes their own random generator

We can create multiple subtypes of RandomGeneratorNodes like NumpyRandomGeneratorNode and NestRandomGeneratorNode that can initialize and pin down random number generation for these libraries we use, and provide a default scaffold one that users can use with self.scaffold.random and can configure from the rng node:

rng:
  scaffold:
    type: numpy
    generator: PCG64
    seed: 15
  nest:
    type: nest
    generator: Philox_64
    seed: 100

This would make self.scaffold.random a numpy PCG64 generator with seed 15, and would set nest.rng_type = 'Philox_64' and nest.rng_seed = 100. We should follow numpy's Generator interface. In the case that we're only setting RNG stuff for a dependency that type of node can just raise NotImplementedErrors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority.high
Projects
None yet
Development

No branches or pull requests

2 participants