Questions tagged [particle-swarm]

In computer science, particle swarm optimization (PSO) is a computational method that optimizes a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality.

In computer science, particle swarm optimization (PSO) is a computational method that optimizes a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality.

Algorithm:

Initialize all agents;
while (not maximum iterations nor minimum error )
{
    foreach(agent in agents) 
     {
        Calculate function value at agent position;
        If (value < best_value_in_history)
            best_value_in_history= value;
    }

    current_best_value= calculate best value of all current agents positions;

    foreach(agent in agents)
    { 
         agent current_velocity =
             w * current_velocity + 
             p * random_double() * (current_best_value.position - current_position) + 
             g * random_double * (best_value_in_history.position - current_position);
         update_agent_position(current_velocity);
    }

}

where w,p,g are selected by the practitioner and control the behaviour and efficacy of the PSO method.

Third party implementations:

  • RRSI is a C# project to simulate particle swarm optimization on communicating robots.
  • SwarmOps C# and ANSI C codes for several optimization methods, including a few global best PSO variants.
  • Java Based PSO Framework part of the open-source project CIlib (Computational Intelligence Library).
  • PSO visualisation applet randomly generated particle swarm of 12 particles attempts to find the "global maximum" on the landscape.
175 questions
2
votes
1 answer

Choosing initial positions in pyswarm (Particle Swarm Optimization)

I am applying PSO in an optimization problem. I have a cost function c(x), in which x is a n dimensional array. Using pyswarms it is possible to calculate the minimum using swarm_size = 200 dim = len(X) # Dimension of X epsilon = 1.0 options =…
donut
  • 628
  • 2
  • 9
  • 23
2
votes
1 answer

Particle position not being parametrized properly in pyswarms

I am having trouble designing a fitness function for pyswarms which will actually iterate through the particles. I am basing my design off of this (working) example code: # import modules import numpy as np # create a parameterized version of the…
wfgeo
  • 2,716
  • 4
  • 30
  • 51
2
votes
1 answer

Can PSO converge at a point with non-zero derivative?

I am using this library - https://pythonhosted.org/pyswarm/ to find the global minima of a convex function. This is just to get started and work towards a non-convex function. I found the global minima using linear regression but the problem is that…
2
votes
1 answer

Solving a Pyomo model with heuristic method (GA or PSO)

1) I was wondering if it is possible to integrate different heuristic solvers like GA and PSO available as python packages to solve a pyomo model. 2) Also, I want to know how to integrate a heuristic algorithm written completely by me (i.e. not…
2
votes
1 answer

How can I optimise the weights of CNN using PSO?

I want to optimize the weights of CNN using Particle Swarm Optimization. Basically weights are at penultimate layer and filters that are tobe optimised. The PSO replaces the optimisers and rest work is done in same way. Will it be possible by using…
Bhaskar Dhariyal
  • 1,343
  • 2
  • 13
  • 31
2
votes
0 answers

How to use different loss functions with the PSO optimised Neural Network code?

I am using pyswarms PSO for neural network optimisation. I am trying to create a network of input layer and output layer. # Store the features as X and the labels as y X = np.random.randn(25000,20) y = np.random.random_integers(0,2,25000) #…
Bhaskar Dhariyal
  • 1,343
  • 2
  • 13
  • 31
2
votes
0 answers

List isn't showing on UI?

I am currently building a UI to support a PSO project on mobile phone optimisation. I have a listview that displays user input arraylist, however when I click the "addservice" button on my UI, the listview's don't show anything?? Below is my code…
Az Islam
  • 133
  • 11
2
votes
2 answers

How many offspring should we produce in Genetic Algorithm?

Suppose I have 100 popsize, should I make 10 offspring? I want the best combination between popsize and offspring to achieve convergent quickly and please also include the paper.
2
votes
1 answer

Particle in the Particle swarm optimization (PSO)

If I have an array A that consist of 50 elements, and I want to use the Particle swarm optimization (PSO) algorithm, to generate another array B with the same size (50 elements). Where the value of the elements in B are similar or nearest to the…
shdotcom
  • 157
  • 1
  • 11
2
votes
1 answer

Particle Swarm Optimization (PSO) with invalid candidate solutions

I created a simple model for an off-grid neighborhood its energy balance, based on solar, wind and some energy storage. I use PSO to find the minimum required solar and wind capacity required for no loss of power throughout a full year. More…
2
votes
1 answer

Compare the structure of Genetic Algorithm (GA) with the structure of Particles swarm Optimization (PSO)

When we compare the structure of Genetic Algorithm (GA) with the structure of Particles swarm Optimization (PSO) is possible to say that: The Population in GA = the Swarm in PSO. The chromosome (potential solution) in GA = the Particle (potential…
shdotcom
  • 157
  • 1
  • 11
2
votes
1 answer

Fish Swarm algorithm issue

I've got a project, to create a very basic PSO (fish swarm) on matlab. What I've done so far: 1) I've setted the dimensions of the axis, 2) I create a fish swarm of 50 fishes with random x,y coordinates and I plot them (the swarm coordinates are…
Jason2000
  • 21
  • 3
2
votes
1 answer

How to apply PSO in Artificial Neural Network

I have a problem to understand the concept of the Particle Swarm Algorithm. for writing the code we scatter some articles into our space and trying to find a place (for example min of a function or desire target). based on position, velocity and so…
Mohammad Yousefi
  • 563
  • 2
  • 7
  • 21
2
votes
0 answers

How to use Particle Swarm Optimization as a Search Space Optimizer

I have two problems regarding PSO; (1). I have a problem in which I need to find the optimal or nearly optimal set of solutions. So PSO should work as an optimizer rather than being a function minimizer. (2). As the fitness function, what I have…
1
vote
2 answers

Particle Swarm Optimization

I'm using Particle Swarm Optimization(PSO) in java. I am having little knowledge about what we do. Since, I am applying for multiple sequence alignment in bioinformatics. We need to find position and velocity for aligning those sequences. I need…
Hariharan
  • 881
  • 1
  • 13
  • 25
1
2
3
11 12