You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to be a bug related to the way the population evolves. AFAIU, when returning from the algorithm, PSO will return the best fit ( important code here ), and then, in the next run, X will be in relation to lbX. While when running the code iteratively with multiple generations (and assuming that one generation didn't perform better than the previous, then X and lbX will be different ( important code here )
There are several ways of solving this. The simplier, I believe, is to update keep an internal m_X in the PSO algorithm class. What are your thoughts around this? Are you interest in a specific fix just to the PSO algorithm (I can open a PR)?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
@darioizzoI didn't make the pso_gen modifications yet because I wanted to show the pso version first, so you can validate if everything is as expected in terms of project patterns, and also your expectation around this. Feel free to ask for modifications.
Also note that I had to make further modifications in order to make all variations of pso to work in the test case. Perhaps you find it to be a little overengineered... Feel free to suggest modifications around the implementation. I tried to make it as explicit as I could to avoid confusion for future readers from the code.
I'm planning on making similar changes (and adding similar test) to pso_gen after you take a look at the PR :)
According to this discussion, all algorithms should behave the same with
gen=N
vsN
calls withgen=1
(Did I understand correcly?).I tried with PSO in pygmo, and couldn't make it work (Will explain better after showing the code):
Results:
pso_run_a: 35.042803177459504
pso_run_b: 14.44962519803876
It seems to be a bug related to the way the population evolves. AFAIU, when returning from the algorithm, PSO will return the best fit ( important code here ), and then, in the next run,
X
will be in relation tolbX
. While when running the code iteratively with multiple generations (and assuming that one generation didn't perform better than the previous, thenX
andlbX
will be different ( important code here )There are several ways of solving this. The simplier, I believe, is to update keep an internal
m_X
in thePSO
algorithm class. What are your thoughts around this? Are you interest in a specific fix just to the PSO algorithm (I can open a PR)?Thanks in advance!
The text was updated successfully, but these errors were encountered: