LibOptimization
LibOptimization copied to clipboard
When initializing DE with upper and lower bounds, do not evaluate the point twice
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:
-
clsOptDE.Init()
: generate a random point using initial value ranges - Create and evaluate the
clsPoint
- Limit the solution space to upper and lower bounds
- Reevaluate the point
You can see the point is evaluated twice, in steps #2 and #4
Ideal process:
- Generate a random point using the upper and lower bounds if they exist (don't use initial value ranges)
- 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 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.
sorry. re-open this issue.