Closed fck1984 closed 4 years ago
Hmmm I don't get any issues when setting the seed like this. Just to be sure, you are setting the seed the same way before each run, correct?
ye,every round~
Can you show the output from sessionInfo(). Also, can you confirm that the following returns TRUE:
library(ParBayesianOptimization)
sf <- function(x) 100 - x^2
FUN <- function(x) {
return(list(Score = sf(x)))
}
bounds = list(
x = c(-2,2)
)
set.seed(1991)
optObj <- bayesOpt(
FUN
, bounds
, initPoints = 4
, iters.n = 2
, verbose = 0
)
set.seed(1991)
optObj2 <- bayesOpt(
FUN
, bounds
, initPoints = 4
, iters.n = 2
, verbose = 0
)
identical(optObj$scoreSummary,optObj2$scoreSummary)
identical(optObj$scoreSummary,optObj2$scoreSummary) [1] FALSE
output seems identical to me `> optObj$scoreSummary Epoch Iteration x gpUtility acqOptimum inBounds Elapsed Score 1: 0 1 0.6633560 NA FALSE TRUE 0.001 99.55996 2: 0 2 1.3760146 NA FALSE TRUE 0.005 98.10658 3: 0 3 -0.9862286 NA FALSE TRUE 0.000 99.02735 4: 0 4 -1.4074789 NA FALSE TRUE 0.000 98.01900 5: 1 5 0.6520079 0.6474753 TRUE TRUE 0.000 99.57489 6: 2 6 0.2285763 0.6273672 TRUE TRUE 0.000 99.94775 errorMessage 1: NA 2: NA 3: NA 4: NA 5: NA 6: NA
optObj2$scoreSummary Epoch Iteration x gpUtility acqOptimum inBounds Elapsed Score 1: 0 1 0.6633560 NA FALSE TRUE 0.000 99.55996 2: 0 2 1.3760146 NA FALSE TRUE 0.001 98.10658 3: 0 3 -0.9862286 NA FALSE TRUE 0.000 99.02735 4: 0 4 -1.4074789 NA FALSE TRUE 0.000 98.01900 5: 1 5 0.6520079 0.6474753 TRUE TRUE 0.000 99.57489 6: 2 6 0.2285763 0.6273672 TRUE TRUE 0.000 99.94775 errorMessage 1: NA 2: NA 3: NA 4: NA 5: NA 6: NA`
HI Sam: Nice work! I really appreciate it. But I have a non-reproducible problem. I ran my code twice,and set the seed,but the output are a little different. I mean,is the output always different,or I did something wrong. code as follow:
and the output: