rBayesianOptimization icon indicating copy to clipboard operation
rBayesianOptimization copied to clipboard

Error: Non-finite value supplied by optim

Open kojima-albert opened this issue 8 years ago • 7 comments

The rBayesianOptimization sometimes generates an error Non-finite value supplied by optim during the iteration. The numbers of round in which I get this error are different every time. Below is my code.

func <- function(x, y){
  return(list(Score = - x ^ 2 + cos(10 * x) - y ^ 2 + cos(10 * y), Pred = 0))
}

library(rBayesianOptimization)

opt <- BayesianOptimization(
  func
  , bounds = list(x = c(-1.0, 1.0),
                  y = c(-1.0, 1.0))
  , init_points = 5
  , n_iter = 100
  , kappa = 2.576
  , eps = 0.0
  , acq = "ei"
  , verbose = TRUE
)


Is there a way to avoid this error and make rBayesianOptimization finish the iteration?

kojima-albert avatar Sep 11 '17 02:09 kojima-albert

I am also having this problem and thus, I am wondering if this issue was resolved. I have assured that the input matrix is full rank, as I thought this may be the cause of the problem.

I love the package and would really appreciate support on this issue.

jasonhearn avatar Oct 13 '17 16:10 jasonhearn

Same situation as with jasonhearn. Can not figure out the reason.

yatzy avatar Apr 12 '18 12:04 yatzy

I am hitting the same issue. Would love some help on this!

I did some digging around in the code. For me, the error was thrown when I run the optim_result <- optim(...) function in Utility_Max. I suspect it might be hitting an unstable minimum for me. Do you have suggestions on how to resolve this?

I'm considering changing the control = list(maxit = 100, factr = 5e11) parameter. However, what would be a reasonable range for this for GP optimization?

Thanks!!

jmzeng avatar Apr 16 '18 01:04 jmzeng

Got the same issue today. I'd really appreciate if it were fixed.

semenoffalex avatar Apr 14 '19 14:04 semenoffalex

I'm also getting this issue.

jlandman avatar Apr 20 '19 17:04 jlandman

I had the same error.

What worked for me was to change the acquisition function from Expected improvement to GP lower confidence bound.

TheXu avatar Oct 30 '19 23:10 TheXu

changing acquisition function to acq = "ucb" solved this for me too.

csetzkorn avatar Jul 20 '21 14:07 csetzkorn