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

Development Roadmap #5

Closed
9 of 22 tasks
ljvmiranda921 opened this issue Jul 25, 2017 · 11 comments
Closed
9 of 22 tasks

Development Roadmap #5

ljvmiranda921 opened this issue Jul 25, 2017 · 11 comments
Assignees
Labels
enhancement Feature requests help wanted Help is much appreciated stale Not much activity here

Comments

@ljvmiranda921
Copy link
Owner

ljvmiranda921 commented Jul 25, 2017

Development Roadmap

Here is the feature list needed for the major release. We will be implementing different PSO variants, more test functions, and a hyperparameter search utility.

Optimizers

  • Binary PSO (pyswarms.single.BPSO) [1]
  • Vanilla Multi-Objective PSO (pyswarms.multi.MOPSO) [2]
  • Constrained PSO (pyswarms.constrained.CPSO) [3]

Test Functions

Most of the good test functions can be found here. If you want to implement a single function, just make a pull request, and then implement it. In fact, even Wikipedia (I know, I know) has a good resource for test functions.

Single-objective pyswarms.utils.single_obj

  • Beale's Function
  • Goldstein–Price function
  • Booth's function
  • Bukin function N.6
  • Matyas function
  • Lévi function N.13
  • Schaffer function N. 2

Multi-Objective pyswarms.utils.multi_obj

  • Binh and Korn function
  • Chakong and Haimes function
  • Fonseca and Fleming function
  • Test function 4
  • Schaffer function N. 1
  • Schaffer function N. 2

Constrained Problems pyswarms.utils.constrained_obj

  • Rosenbrock function constrained with a cubic and a line
  • Rosenbrock function constrained to a disk
  • Mishra's Bird function - constrained
  • Townsend function
  • Simionescu function

Utilities

  • Hyperparameter search methods (grid search and random search)

Examples

We need various examples or use-cases to help a user use PySwarms. For now, these things are much better written in a Jupyter Notebook.

No. Reference
[1] J. Kennedy and R.C. Eberhart, "A discrete binary version of the particle swarm algorithm," in IEEE International Conference on Systems, Man, and Cybernetics, 1997.
[2] M.R. Sierra and C.A. Coello, "Multi-Objective Particle Swarm Optimizers: A Survey of the State-of-the-Art," International Journal of Computational Intelligence Research, 2006.
[3] Parsopoulos, Konstantinos E., and Michael N. Vrahatis. "Particle swarm optimization method for constrained optimization problems," Intelligent Technologies–Theory and Application: New Trends in Intelligent Technologies pp. 214-220, 2006.
@ljvmiranda921 ljvmiranda921 added enhancement Feature requests help wanted Help is much appreciated labels Jul 25, 2017
@ljvmiranda921 ljvmiranda921 self-assigned this Jul 25, 2017
@ljvmiranda921 ljvmiranda921 added this to the First Major Release (v1.0.0) milestone Jul 25, 2017
@Carl-K
Copy link
Contributor

Carl-K commented Jul 25, 2017

I'll do Beale's Function!

@ljvmiranda921
Copy link
Owner Author

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

@Carl-K
Copy link
Contributor

Carl-K commented Jul 27, 2017

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.

@ljvmiranda921
Copy link
Owner Author

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!

@Carl-K
Copy link
Contributor

Carl-K commented Jul 27, 2017

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.

@ljvmiranda921
Copy link
Owner Author

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! 👍

@SioKCronin
Copy link
Collaborator

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.

@ljvmiranda921
Copy link
Owner Author

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!

@abougouffa
Copy link

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?

@ljvmiranda921
Copy link
Owner Author

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!

@abougouffa
Copy link

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

Thank you for your responsiveness 😃

@ljvmiranda921 ljvmiranda921 changed the title Feature List for Major Release Feature List for Next Release Oct 7, 2017
@ljvmiranda921 ljvmiranda921 changed the title Feature List for Next Release Development Roadmap Oct 7, 2017
@ljvmiranda921 ljvmiranda921 added the stale Not much activity here label Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests help wanted Help is much appreciated stale Not much activity here
Projects
None yet
Development

No branches or pull requests

4 participants