-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
(De-)Coupling between operators and topologies #259
Comments
Hello @bastinat0r and welcome to PySwarms! 😄 Thank you for your feature request. To me it sounds a bit like the BoundaryHandler we are currently developing #238 but instead of choosing how to handle the boundaries you would like to choose how the velocity and the new positions are calculated, right? I think we could consider this after release 0.4. We are currently very low on labour resources so it might take a while 😄. Although, I reckon that with some smart ideas this wouldn't even be that hard to implement 🤔. |
@ljvmiranda921 I think this is actually pretty easy. Since the |
As a sidenote, @ljvmiranda921, if you want to keep the |
Yeah, hmm, I agree with you @whzup , it seems that from an API standpoint it's quite a lot to generalize or decouple. I think your latter suggestion works, pass the But hmm, I also have this pull that it's actually ok to not decouple between compute position and compute velocity from the topologies? Like the toplogy guides how the computations happen, so it's fine if they're connected. Let me know your thoughts! Wow, this has been a longstanding feature, but a good time to revisit! |
Ok so just as an example, I worked on an integer optimizer for #400 (see there for the source). For that integer optimizer, one needs to have custom There are 2 points for why I think we should decouple:
I think one definitively can work with custom operators at the moment but it feels unpolished, at least to me. As I see it, if we uncoupled them we would open up the ground for an even more general optimizer and give the backend a more sensible structure. I would then actually just remove the methods for |
@ljvmiranda921 I have a branch prepared with the changes (all tests pass). If you approve of this change I'd be ready to put a PR. |
Ok you've convinced me on this part. I do agree that our custom operators are still unpolished, and I haven't seen users try to use them or build their own optimization logic from scratch. I think moving forward you're right, it's good that we decouple them as much as possible so that users can either (1) arrange the parts as they see fit, and/or (2) just use our premade optimizers. Just note that I'm wary of abstracting this too much, so let's be careful on that! Ok, I'm excited to see the PR! Might be able to review this over the weekend instead! |
Is there any update on this? Would be super useful to have this decoupling implemented if possible, so that variations on the standard PSO (such as an FDR-PSO) can be created in PySwarms? |
Closing stale issues. Unfortunately, I think no one has the bandwidth to implement this feature. Please reopen this again if you think can contribute or still needed |
Is your feature request related to a problem? Please describe.
I want to use PySwarms to benchmark several state of the art PSO-Algorithms (and some modifications for them). As I understood the current code-base implementing another variant that uses another velocity update (like the one used in SPSO2011) does not fit neatly into the current Class-dependencies, as the topologies do depend on the operators that are used. In my research I use, different operators with different topologies.
For reference the SPSO paper
Describe the solution you'd like
Decoupling of operators and topologies would suit the implementation of new algorithms, maybe that can help to gather new algorithms into PySwarms.
Describe alternatives you've considered
I'm not really sure what is the best way to achieve this. Maybe the operator can be passed as a named argument, thus the implementation is easier. I guess the cleanest approach is decoupling though.
Additional context
I want to test new algorithms/modifications regarding other metrics relevant to robotic applications of PSO (as part of my PhD topic). This coupling is really what keeps me from using pyswarms at the moment. There is however a real lack of (Single Objective) PSO frameworks out there so real heads up for the project!
The text was updated successfully, but these errors were encountered: