Code Monkey home page Code Monkey logo

Comments (1)

marcomangano avatar marcomangano commented on July 28, 2024

Hello @kmodexc, thanks for sharing a MWE, I could replicate your error.
I initially thought this was a bug, but if you diff alpso.py and alpso_ext (the latter is the one imported when "parallelType": "EXT") you will see how the parallel version expects a different objFunc signature that returns a vector f of len(swarsize) instead of a scalar.
I am not familiar with this PSO algorithm , but in the default mode alpso loops over every particle of the swarm and evaluates the (scalar) objfunc at that point. In the parallel version, there is no such loop. We do not have examples afaik, but it looks like alpso_ext passes an array with all the DVs of all the particles at a given iteration, and expects a vector f with all the function values of the particles at the same iteration.

In short, if you remove the "parallelType": "EXT" option the optimizer will work. To run the optimizer in parallel mode, it is on the user to provide an objfunc that runs in parallel and returns a vector of the correct size.

from pyoptsparse.

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.