Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mean_neighbor_cost value in history Tuple of optimizers #513

Open
mmfarrugia opened this issue May 22, 2023 · 0 comments
Open

mean_neighbor_cost value in history Tuple of optimizers #513

mmfarrugia opened this issue May 22, 2023 · 0 comments

Comments

@mmfarrugia
Copy link

I noticed while extending pyswarms for epsilon constrained optimization that the value passed to mean_neighbor_cost in the SwarmOptimizer.ToHistory Tuple (the hist tuple which is then passed to SwarmOptimizer._populate_history method as an argument) is just self.swarm.best_cost. Did I misunderstand the way that this works since swarm.best_cost comes from the topology's implementation of compute_gbest method, or should this be a mean of the neighboring costs not a max/best global cost? I noticed that it is indeed the mean in local_best so I figured that this is either unintentional although the code works or I need to better understand the implementation and how mean_neighbor_cost is used because it makes sense that there would be this kind of difference but I couldn't seem to track down where it is used in the code. I understand that it is then appended to mean_neighbor_history, but I couldn't find any references to this variable that used it. Thank you for your help, I hope to contribute a constrained implementation of the pyswarms library soon based off of Takahama et al 2005 epsilon approach.

It is on line 261 of general_optimizer.py, line 221 on global_best.py, line 249 of local_best.py in pyswarms/single folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant