mealpy icon indicating copy to clipboard operation
mealpy copied to clipboard

[BUG]: Optimization direction is wrong when `max` is set for `minmax` setting

Open lewis738 opened this issue 3 years ago • 0 comments

Description of the bug

I'm using ACOR optimizer, and i set "minmax" as "max", when i just started to solve, the optimizer selected the max fitness as the global best, But the bug is, as the epoches goes on, the current fitness is decresing! A optional solution is: add a minus sign to the object function, and set minmax as min 在选用ACOR算法,"minmax"设置为 "min"时候,优化方向的方向错误 即:在初代种群中选出了fitness最大的一组后,后续迭代似乎在尝试最小化fitness,输出的信息如后续Info所示, 可考虑的解决方案:给目标函数加上负号,将minmax修改为min

Steps To Reproduce

  1. use ACOR optimizer( other optimizers not tested)
  2. set minmax as min
  3. start solving

Additional Information

Epoch: 1, Current best: -7.61656849045883, Global best: 37.61266673850652, Epoch: 2, Current best: -8.29316400787176, Global best: 37.61266673850652, ...... Epoch: 15, Current best: -24.07365247725762, Global best: 37.61266673850652, ...... Epoch: 100, Current best: -27.76862755410546, Global best: 37.61266673850652,

lewis738 avatar Sep 18 '22 10:09 lewis738