Comments (4)
It's planned, but we don't have a timeline for it yet.
from pagmo2.
meanwhile something along these lines works good enough for me:
import multiprocessing as mp
import pygmo as pg
def pop_init(nPop, seed):
prob_def = YourProblem()
prob = pg.problem(prob_def)
return pg.population(prob, nPop, seed=seed)
if __name__ == "__main__":
# since pygmo does not use multi threading for the initialisation and the initialisation calls fitness
# this may take forever if done on a single thread. By initialising the populations in a separate mp.pool
# and adding them to the archipelago afterwards this can be compensated
nPop = 16
nGen = 8
nWorker = 32
nIslands = 32
# create all populations
with mp.Pool(nWorker) as pool:
populations = pool.starmap(pop_init, [(nPop, seed) for seed, nPop in enumerate([nPop] * nIslands)])
# add them to new islands in the otherwise empty archipelago
archipelago = pg.archipelago()
for pop in populations:
archipelago.push_back(algo=pg.algorithm(pg.sade(nGen)), pop=pop, udi=pg.mp_island())
archipelago.wait()
# 'the work' must continue!
from pagmo2.
There is now something we call a "batch fitness evaluation" scheme in pagmo which is used, among other things, to parallel init populations, islands and archipelagos in C++.
We are currently lacking the capability in Python, but it is not difficult to implement and all the necessary pieces are there. The code won't be long, and it will be very similar to the workarounds @Argysh and other have posted in the past.
We will get there with Python batch fitness evaluators, it's just a matter of manpower as usual, and we are busy with many other things in pagmo at this particular time (migration, topology, new algorithms, etc.).
If anyone wants to take the lead, this should be a good entry-level contribution to pagmo, and we would be willing to offer all the assistance needed. A good starting point would be the documentation of the bfe class in Python:
https://esa.github.io/pagmo2/docs/python/py_bfe.html
As usual, we are available on gitter for discussing possible contributions and answering questions in (almost!) real time:
https://gitter.im/pagmo2/Lobby
from pagmo2.
The batch fitness evaluation framework has now been completed on the Python side with the release of pagmo 2.13. I will close this report.
from pagmo2.
Related Issues (20)
- MinGW installation problem HOT 1
- how to run pagmo2 in parallel cluster? HOT 1
- [BUG] redundant code in moead.cpp HOT 2
- [BUG] Could NOT find pagmo_IPOPT (missing: PAGMO_IPOPT_INCLUDE_DIR) HOT 1
- [BUG] No 2.19.0 tag HOT 2
- [BUG] moead_gen is not documented HOT 2
- [FEATURE] PAGMO_VERSION HOT 2
- Scaling of design variables and
- How to optimize with algorithms::ipopt? HOT 2
- [BUG] Maximize function with Ipopt: incorrect population returned HOT 2
- [BUG] Compilation problem with IPOPT HOT 7
- Question: Use of Hessian with Ipopt
- pagmo-devel 2.19 build 3 not found by meson build system HOT 5
- Passing arguments in a user defined problem HOT 6
- Uninitialized variables may be used in cec2014 problem
- MPI Island class for cluster computing HOT 1
- Avoid multiple definitions of mathematical constants
- No "NaN/infinity" verification in sbx crossover implementation AND no bounds verification for NSGA-II's initial population
- Add NSGA-III implementation
- Question about get_bounds() HOT 3
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 pagmo2.