Skip to content

Commit

Permalink
More agressive replacement of RandomState with default_rng
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Shinnar <[email protected]>
  • Loading branch information
shinnar committed Aug 22, 2024
1 parent e237f5b commit 626df14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lale/lib/lale/smac.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def f(trainable):
try:
smac = orig_SMAC(
scenario=self.scenario,
rng=np.random.RandomState(42),
rng=np.random.default_rng(42),
tae_runner=lale_op_smac_tae(self.estimator, f),
)
incumbent = smac.optimize()
Expand Down
4 changes: 2 additions & 2 deletions test/test_optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_smac(self):
tae = iris_fmin_tae(lr, num_folds=2)
print("Optimizing! Depending on your machine, this might take a few minutes.")
smac = orig_SMAC(
scenario=scenario, rng=np.random.RandomState(42), tae_runner=tae
scenario=scenario, rng=np.random.default_rng(42), tae_runner=tae
)

incumbent = smac.optimize()
Expand Down Expand Up @@ -167,7 +167,7 @@ def dont_test_smac_choice(self):
tae = iris_fmin_tae(planned_pipeline1, num_folds=2)
print("Optimizing! Depending on your machine, this might take a few minutes.")
smac = orig_SMAC(
scenario=scenario, rng=np.random.RandomState(42), tae_runner=tae
scenario=scenario, rng=np.random.default_rng(42), tae_runner=tae
)

incumbent = smac.optimize()
Expand Down

0 comments on commit 626df14

Please sign in to comment.