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
Name: pyswarms 1.3.0
Python version: 3.11.0
Operating System: Windows 10
Description
After running global best and local best PSO I noticed that my best cost is NOT reproducible with the final position vector returned after the optimizer is done running.
I think there is a major issue with position return in 'optimize' method in global, local, binary and general optimizers.
From what I understand from reviewing the code, the 'final_best_pos' is only the best position vector of the last iteration of the swarm. This does NOT return the global best position found. I think it should simply be:
PySwarms version:
Description
After running global best and local best PSO I noticed that my best cost is NOT reproducible with the final position vector returned after the optimizer is done running.
I think there is a major issue with position return in 'optimize' method in global, local, binary and general optimizers.
final_best_cost = self.swarm.best_cost.copy()
final_best_pos = self.swarm.pbest_pos[self.swarm.pbest_cost.argmin()].copy()
From what I understand from reviewing the code, the 'final_best_pos' is only the best position vector of the last iteration of the swarm. This does NOT return the global best position found. I think it should simply be:
final_best_cost = self.swarm.best_cost.copy()
final_best_position = self.swarm.best_pos.copy()
Thoughts ?
The text was updated successfully, but these errors were encountered: