Skip to content

Commit

Permalink
Provisory suggestion to generate reproducible seeds for each fold in …
Browse files Browse the repository at this point in the history
…ModelTrainer.hyperparametrizable
  • Loading branch information
Cmurilochem committed Oct 31, 2023
1 parent 5ef7787 commit 3ce533e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion n3fit/src/n3fit/model_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,8 @@ def hyperparametrizable(self, params):
if k > 0:
# seeds = [np.random.randint(0, pow(2, 31)) for _ in seeds]
# generate seeds for each k-fold from the input `nnseeds`
seeds = [seed * k for seed in seeds]
seeds_gerator = [np.random.default_rng(seed=seed) for seed in seeds]
seeds = [generator.random() for generator in seeds_gerator]

# Generate the pdf model
pdf_models = self._generate_pdf(
Expand Down

0 comments on commit 3ce533e

Please sign in to comment.