Comments (5)
Hi @ibell , let me get to this during the weekend, currently traveling so I can't access my work laptop
from pyswarms.
Actually, the bug was/is in my understanding. I didn't realize that the inputs to the objective functions should be vector inputs (all inputs are evaluated in parallel). Maybe that just needs to be clarified in the docs. I think in the docs it makes more sense to use a hard-coded function so you can see what is going on rather than using a baked in function.
from pyswarms.
Hi @ibell , understood. Yes you are correct, the documentation still leaves a lot for improvement and it would be nice to do these upgrades. Just in case, would you also like to include this 'clarification' in your Pull Request?
from pyswarms.
Reference #107
from pyswarms.
I know this is quite old
But i bumped into the same problem and I can't figure out how to write my own function and pass it as objective function
Could you give me some instructions?
I'm trying to make a simple example:
import pyswarms as ps
from pyswarms.utils.functions import single_obj as fx
def f(x):
return x**2
options = {'c1':0.5, 'c2': 0.3, 'w':0.9}
optimizer = ps.single.GlobalBestPSO(n_particles=100, dimensions=2, options=options)
best_cost, best_pos = optimizer.optimize(f, iters=100)
print(best_cost)
print(best_pos)
from pyswarms.
Related Issues (20)
- 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' HOT 2
- 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()
- 3D Plotting Broken HOT 1
- networkx graph netwrok data
- Add docs that pyswarms is minimization solver HOT 1
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.