yanyachen / rBayesianOptimization

Bayesian Optimization of Hyperparameters
81 stars 21 forks source link

is this a bug #15

Closed danieltba closed 7 years ago

danieltba commented 7 years ago

I have tried this with both the stable and dev package:

Test_Fun <- function(a,b) { list(Score = fitness(c(a,b),27), Pred = 0) } OPT_Res <- BayesianOptimization(Test_Fun, bounds = list(a = c(0.1, 6),b=c(0.1,6)), init_points = 10, n_iter = 200, acq = "ei", verbose = TRUE)

the initial sampling is done without troubles, but after the 10 initial iterations i get this error:

elapsed = 4.57 Round = 10 a = 3.6569 b = 2.5497 Value = 118.9953 Error in .C("maximinLHS_C", as.integer(n), as.integer(k), as.integer(dup), : "maximinLHS_C" not resolved from current namespace (lhs)

the traceback:

maximinLHS(param_search, d) 7. GPfit::GP_fit(X = Par_Mat[Rounds_Unique, ], Y = Value_Vec[Rounds_Unique], corr = kernel, ...) 6. eval(expr, envir, enclos) 5. eval(expr, pf) 4. withVisible(eval(expr, pf)) 3. evalVis(expr) 2. utils::capture.output({ GP <- GPfit::GP_fit(X = Par_Mat[Rounds_Unique, ], Y = Value_Vec[Rounds_Unique], corr = kernel, ...) }) 1. BayesianOptimization(Test_Fun, bounds = list(a = c(0.1, 6), b = c(0.1, 6)), init_points = 10, n_iter = 200, acq = "ei", verbose = TRUE)

wonder if its a bug or something in my environment. Best regards

yanyachen commented 7 years ago

Could you provide a minimal reproducible example code for this potential error?

danieltba commented 7 years ago

I found out it was a matter of my function invoking a library and that causing some issues. I recoded my function and everything is working fine now.

Thank you.