Skip to Content.
Sympa Menu

opal - Re: [Opal] Optimiser

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] Optimiser


Chronological Thread 
  • From: "Snuverink Jochem (PSI)" <jochem.snuverink AT psi.ch>
  • To: "Bellotti Renato (PSI)" <renato.bellotti AT psi.ch>
  • Cc: "opal AT lists.psi.ch" <opal AT lists.psi.ch>
  • Subject: Re: [Opal] Optimiser
  • Date: Wed, 6 May 2020 16:23:34 +0000
  • Accept-language: en-US, de-CH

Dear Renato,


The optimiser is not optimised to find the first generation quickly. There is an optimizer flag called `INITIAL_OPTIMIZATION`, if you set this to TRUE (default FALSE), it will speed up the first generation. It is mostly for finding the last feasible individuals, so it will probably not help in your case.


This sounds interesting. What does this option do, and what do you mean by "the last feasible individuals"?


I didn't word it very well, I'll try with an example. Say you have 100 cores and 100 individuals in your first generation. Then if 75 individuals are found that fulfil the constraints, then by default only 25 new individuals are tried, which means not all cores are running, and it can take a while until the first generation is ready. However with the flag on, all cores are kept busy until 100 individuals are found that fulfil the constraints. The remaining individuals that are still running will end up in generation 2. So the flag messes up the traditional logic of a genetic algorithm, but all cores are kept busy, resulting in more evaluations. It is particularly useful when finding the first generation takes a considerable amount of time.


What you can also do is generate the feasible solutions with the surrogate model, make a JSON generation file from them, and start the optimisation with that generation (`STARTPOPULATION`).

This is not possible because I'd like to calculate the speedup of running an optimisation with the surrogate model vs. with OPAL.

I think if you want a true comparison, I would advise to run the same optimiser on both models to eliminate the implementation and settings of the genetic algorithm as a possible error source. You could probably do this with the pymoo library and runOPAL.py. It might not be easily parallelisable that way though.

I am also wondering how do you / pymoo sample the first generation? OPAL does a random search, and eventually feasible solutions should be found. Does pymoo do the same or use something more clever? (by looking how far it is from the constraints for example, or a grid search).

And what about reducing the bounds of the input, or easing the constraints? Based on the surrogate model solutions, do you have an idea about the chance of finding a feasible solution with a random search?

Cheers, Jochem


From: Bellotti Renato (PSI)
Sent: Wednesday, May 6, 2020 3:46 PM
To: Snuverink Jochem (PSI)
Cc: opal AT lists.psi.ch
Subject: Re: [Opal] Optimiser
 

Dear Jochem,


Thanks for your answer.


Did you verify that the solutions you found with the surrogate model are also solutions with OPAL? (That is run the OPAL-simulation with that input and verify that it fulfils all constraints).


I have fed the Python-optimised configurations to OPAL, and the constraints are still fulfilled.


The optimiser is not optimised to find the first generation quickly. There is an optimizer flag called `INITIAL_OPTIMIZATION`, if you set this to TRUE (default FALSE), it will speed up the first generation. It is mostly for finding the last feasible individuals, so it will probably not help in your case.
This sounds interesting. What does this option do, and what do you mean by "the last feasible individuals"?
What you can also do is generate the feasible solutions with the surrogate model, make a JSON generation file from them, and start the optimisation with that generation (`STARTPOPULATION`).
This is not possible because I'd like to calculate the speedup of ranning an optimisation with the surrogate model vs. with OPAL.

Hope that helps,
Jochem

This helps a lot, thank you!


Cheers,


Renato



From: opal-request AT lists.psi.ch <opal-request AT lists.psi.ch> on behalf of Renato Bellotti <renato.bellotti AT psi.ch>
Sent: Tuesday, May 5, 2020 4:10 PM
To: opal AT lists.psi.ch
Subject: [Opal] Optimiser
 

Dear OPAL developers,

I am experiencing problems with the optimiser. I am trying to solve the following problem:

You can see that I try to restrict the beam size within the first 10m of the accelerator.

Unfortunately, the optimiser does not find a single feasible individual, although it has tried > 7500 configurations.

I know that the problem has solutions that fulfil the constraint: Thanks to an ML surrogate model, I was able to run the optimisation with the pymoo Python library.

I am now a bit at a loss that OPAL cannot solve the problem while the Python library can. Am I doing something wrong in the config file (see appendix)?

I'm looking forward to your answers,

Renato




Archive powered by MHonArc 2.6.19.

Top of Page