Try printing the value of `param` in your `obj` function before calling train() or getTrainPerf(). Optimizers are prone to giving unexpected values [*] in trying to lower the loss function. It might be the case of an unconstrained optimizer leaving the realm of the feasible because no-one told it not to.
-- Best regards, Ivan [*] See e.g. https://arxiv.org/abs/1803.03453 for examples of very unorthodox ways of gaming the fitness fuction ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.