LibOptimization icon indicating copy to clipboard operation
LibOptimization copied to clipboard

When initializing DE with upper and lower bounds, do not evaluate the point twice

Open soricinae opened this issue 3 years ago • 2 comments

Today, when initializing DE with upper and lower bounds, points are evaluated twice. This is inefficient and noticeable when evaluation is expensive.

Today's process:

  1. clsOptDE.Init(): generate a random point using initial value ranges
  2. Create and evaluate the clsPoint
  3. Limit the solution space to upper and lower bounds
  4. Reevaluate the point

You can see the point is evaluated twice, in steps #2 and #4

Ideal process:

  1. Generate a random point using the upper and lower bounds if they exist (don't use initial value ranges)
  2. Create the point

In this flow the point is only evaluated once.

There is a secondary bug with the limit function where the random point is not uniformly sampled from the upper and lower bounds. Instead it is uniformly sampled from the initial value ranges, so if the upper and lower bounds are wider, you miss parts of those bounds, and if the bounds are narrower, you are more likely to get "random" points from the edge of the bounds.

soricinae avatar Nov 23 '21 03:11 soricinae

@soricinae Thank you for your issue.

Generate a random point using the upper and lower bounds if they exist You're right. I made a simple implementation.

If there is a bounds, you should make a point with a limited range using RNG. I manage and fix this issue. Expand to other initialization processes.

tomitomi3 avatar Nov 23 '21 16:11 tomitomi3

sorry. re-open this issue.

tomitomi3 avatar Nov 23 '21 16:11 tomitomi3