Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Inclusion of PRIMA solvers in Skit-Optimize #1182

Open
zaikunzhang opened this issue Sep 20, 2023 · 5 comments
Open

Inclusion of PRIMA solvers in Skit-Optimize #1182

zaikunzhang opened this issue Sep 20, 2023 · 5 comments

Comments

@zaikunzhang
Copy link

Dear Scikit-Optimize maintainers,

This is Dr. Zaikun Zhang from The Hong Kong Polytechnic University. Together with Professor N.I.M. Gould, I am responsible for maintaining the renowned derivative-free optimization solvers of the late Professor M.J.D. Powell, namely COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. I am the author of PRIMA, which provides the reference implementation for these solvers. They are widely used by engineers and scientists. For instance, see Section 1 of a recent paper on Powell's solvers as well as the Google searches of COBYLA and BOBYQA.

Since your package is exactly oriented to derivative-free / black-box optimization, it might be desirable to include the PRIMA solvers. I will be happy to assist on the Fortran side if you would like to do so.

Note that, even though the old Fortran 77 implementation of the aforementioned solvers is truly a masterpiece, it contains many bugs (mostly due to the language itself), which can lead to segmentation faults or infinite loops. For example, see Section 4.4 of the above paper and many GitHub issues. It is strongly discouraged to use the Fortran 77 version of these solvers anymore.

Thanks and regards,
Zaikun ZHANG
Ph.D. and Assistant Professor
Dept. App. Math., Hong Kong Polytechnic University

@Deathn0t
Copy link

Dear @zaikunzhang ,

As a user of this package I think the scikit-optimize original repository is not maintained anymore. However, I am working on an updated fork of this package available here within an hyperparameter optimization software called DeepHyper. Also, I was wondering if your approach could be used to optimize the acquisition function within Bayesian optimization. In replacement of lbfgs in scikit-optimize for example (would it perform better?).

Let me know if you are interested to try this out. I have implemented genetic algorithm recently to compare against lbfgs.
Best regards,
Romain EGELE,
Ph.D. at Universite Paris-Saclay.

@zaikunzhang
Copy link
Author

Hi Romain @Deathn0t ,

The solvers in PRIMA can solve black-box optimization problems without requiring derivatives (first-order information). They are quite capable in solving hyper-parameter tuning problems. So they are good solvers to be included in DeepHyper.

if your approach could be used to optimize the acquisition function within Bayesian optimization. In replacement of lbfgs in scikit-optimize for example (would it perform better?).

Sure. Whether it will outperform lbfgs or not, it depends on the properties of the problem. If your problem is a black-box optimization problem, the PRIMA solvers are the state of the art --- they definitely outperform genetic algorithms. However, it your problem can provide first-order information, then gradient-based algorithms will perform better.

Thanks,
Zaikun

@Deathn0t
Copy link

Thanks for your reply @zaikunzhang . Also, I have the following questions:

  1. Is it better to wait for ENH: The Fortran 77 implementation of COBYLA is buggy and challenging to maintain. Switch to the PRIMA implementation? scipy/scipy#18118 and Add Python binding libprima/prima#52 to be completed to use PRIMA with Python or is there a Python binding already usable?
  2. Does it work with mixed-variable spaces (Real, Discrete, Categorical)?
  3. Is there an "asynchronous" interface of the type ask/tell or suggest/observe to use prima in an asynchronous parallel setting?
  4. Can it perform batch vectorized optimization? (instead of inferring the function once per input point, we infer a list of points directly, it can be faster in Python to avoid slow Python for loops)

Thanks,
Romain.

@zaikunzhang
Copy link
Author

zaikunzhang commented Oct 3, 2023

Hi,

Is it better to wait for scipy/scipy#18118 and libprima/prima#52 to be completed to use PRIMA with Python or is there a Python binding already usable?

Yes, you can wait for libprima/prima#52 .

Does it work with mixed-variable spaces (Real, Discrete, Categorical)?

No.

Is there an "asynchronous" interface of the type ask/tell or suggest/observe to use prima in an asynchronous parallel setting?

Not directly. Maybe you can implement that using a callback function, but I am not sure.

Can it perform batch vectorized optimization? (instead of inferring the function once per input point, we infer a list of points directly, it can be faster in Python to avoid slow Python for loops)

Since PRIMA solvers are intrinsically sequential (except for the initialization), I guess the answer is no. However, I do not think calling PRIMA will involve Python for loops --- it will be a single line of Python code, behind which is the Fortran code.

Thank you.

Zaikun

@Deathn0t
Copy link

Deathn0t commented Oct 3, 2023

Thank you for the detailed replies @zaikunzhang !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants