Comments (11)
I'll do Beale's Function!
from pyswarms.
Hi @SioKCronin! That's awesome!
Just fork this repo and do a pull request once you're done. The steps can be seen in this link
Also, if you have questions, need help, or found some bugs, please don't hesitate to contact/raise an issue!
Thank you so much!
from pyswarms.
Hi @ljvmiranda921, I'm working on a project in which I implemented another PSO variant named GLIR-PSO and I can port it to work with pyswarms.
I don't know if you are interested in implementing existing PSO variants or just implement a generic framework?
from pyswarms.
Hi @abougouffa, sure please do port it here in PySwarms! The idea is that we can pool different variants in the library to ease benchmarking for researchers. 👍
However, please do check if the base classes can support GLIR-PSO. Hopefully it does, if there's a need to create a new base class, or improve the existing base classes, just write a message here!
from pyswarms.
Hey @Carl-K! Go ahead! Just leave a message in #6 if you ran into any problem/confusion 👍 😄
from pyswarms.
Hello again @ljvmiranda921, I can take care of the rest of the functions (goldstein, booth, bukin6, matyas, levi, schaffer2) and also add extra tests for correct input dimensions (Beale, Goldstein, Booth, etc.) if needed.
from pyswarms.
Hey @Carl-K , wow, that would be really helpful! You can implement the rest of the functions in single_obj.py
for now.
I forgot to mention, it would be really nice if we follow PEP8 standards in writing equations. So for the Beale's function, we can write something like this:
# Line breaks before the operator, notice the parenthesis enveloping
# our equation.
j = ((1.5 - x_ + x_ * y_)**2.0
+ (2.25 - x_ + x_ * y_**2.0)**2.0
+ (2.625 - x_ + x_ * y_**3.0)**2.0)
With regard to the extra tests, I believe I have updated them already in the InputDimFail
class (check this commit). Right now we're still in Pre-Alpha. Once we do a release, we'll start refactoring all our AssertionError
s into raised Exceptions
. But it's still a long way but I'm taking notes on what to change so far so we won't refactor a lot of error-handling in the future. So yeah, just take the assertions and unit tests as it is for now. 👍
Anyways, good job and I hope you're enjoying! Just drop any questions here if needed!
from pyswarms.
Hello @ljvmiranda921 thank you for the guidance it is much helpful. I would just like to bring something to your attention about the tests you have written regarding
with self.assertRaises(AssertionError):
consider
def test_beale_bound_fail(self):
x = np.array([[-5, 5]])
x_ = np.array([[3, 0.5]])
with self.assertRaises(AssertionError):
fx.beale_func(x)
fx.beale_func(x_)
vs
def test_beale_bound_fail(self):
x = np.array([[-5, 5]])
x_ = np.array([[3, 0.5]])
with self.assertRaises(AssertionError):
fx.beale_func(x)
with self.assertRaises(AssertionError):
fx.beale_func(x_)
for Beale's function. The array [3, 0.5] does not raise an assertion error within beale_func(x) because it is valid input, so the test for bounds should fail. In the first example the test does not fail even though it should because I am assuming "with self.assertRaises(AssertionError):" catches an assertion thrown from any line, not all of them, which is what the test currently is. In the second example the test does fail, which I believe is what you want. I hope this is not nitpicky it is just something that caught my eye.
from pyswarms.
Hmmm... interesting. Turns out that context managers (with self.assertRaises(AssertionError)
) work in an any
perspective. Already fixed it (and the others) in the latest commit.
Thanks for catching it! 👍
from pyswarms.
Hi @ljvmiranda921 I'm a CS grad student just beginning to use PSO in my work, and can help out with documentation and the Jupyter examples notebook.
from pyswarms.
OK, great, I will port it when I get some free time 😃.
Thank you for your responsiveness 😃
from pyswarms.
Related Issues (20)
- compute_Pbest - compute gbest weird behavior
- Problem with conditional functions in multi-dimension particles
- How to define a discrete design space when using pyswarms.discrete.binary module
- Final Best Position Logical Error
- init_pos does not seem to work as expected
- TypeError: f() got an unexpected keyword argument 'print_step'
- Tests fail with Matplotlib 3.7
- A toy problem example - need help to use PySwarms
- Release missmatch (Missing release on github)
- Having Issue in optimizer HOT 1
- mean_neighbor_cost value in history Tuple of optimizers
- parallel pyswarms not working
- TypeError: '<' not supported between instances of 'generator' and 'float' HOT 1
- Test failures
- Dependency on future
- Unexpected stagnation with VonNeumann and Pyramid topologies HOT 1
- Typo Error in Documentation: Incorrect Hyperlink for use case examples in Launching Pad Section
- ValueError: Unable to configure handler 'file_default'
- The new open-source Python library **PyPop7** can be used as an alternative to this widely used library for PSO.
- Pyswarms changes dtype from pyten.mp.MPS() to np.ndarray()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyswarms.