Giter Club home page Giter Club logo

Comments (11)

Carl-K avatar Carl-K commented on May 29, 2024 1

I'll do Beale's Function!

from pyswarms.

ljvmiranda921 avatar ljvmiranda921 commented on May 29, 2024 1

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.

abougouffa avatar abougouffa commented on May 29, 2024 1

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.

ljvmiranda921 avatar ljvmiranda921 commented on May 29, 2024 1

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.

ljvmiranda921 avatar ljvmiranda921 commented on May 29, 2024

Hey @Carl-K! Go ahead! Just leave a message in #6 if you ran into any problem/confusion 👍 😄

from pyswarms.

Carl-K avatar Carl-K commented on May 29, 2024

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.

ljvmiranda921 avatar ljvmiranda921 commented on May 29, 2024

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 AssertionErrors 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.

Carl-K avatar Carl-K commented on May 29, 2024

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.

ljvmiranda921 avatar ljvmiranda921 commented on May 29, 2024

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.

SioKCronin avatar SioKCronin commented on May 29, 2024

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.

abougouffa avatar abougouffa commented on May 29, 2024

OK, great, I will port it when I get some free time 😃.

Thank you for your responsiveness 😃

from pyswarms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.