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
1
vote
1 answer

Particle Swam Optimization (PSO) learning and adapting

I have recently implemented a basic algorithm of PSO which when provided with a function of 2 variables(x,y) would return the minima of the function within a range. Now the issue is - the function is not known. My PS is to be fed with data sets…
letsc
  • 2,075
  • 5
  • 24
  • 43
1
vote
0 answers

Python Code for Particle Swarm Optimization

Following is the equation for PSO with passive congregation: In this equation: Ri is a particle randomly selected from a swarm c3 is the passive congregation coefficient r3 is a uniform random sequence in the range (0,1) I am attempting to model…
1
vote
0 answers

How to define steps for particles in pwswarm or pyswarms (Particle Swarm Optimization)

I'm using bellow code to Optimize some parameters but the problem is I can't specify "steps" for values! In this case I want 1x step to generate only integer values but pyswarm generating float numbers. from pyswarm import pso from OPT import…
Mori
  • 11
  • 1
1
vote
0 answers

IndexError: invalid index to scalar variable.- PSO algorithm

While trying to solve this problem using PSO algorithm I got the error message as "IndexError: invalid index to scalar variable". Since I am new to PSO algorithm, I am unable to figure out the error. Kindly help me to solve the issue. import…
1
vote
0 answers

keyerror 'micro avg' cannot running in python when using in particle swarm optimization program

# ------------------------------------------------------------------------------+ # # Nathan A. Rooy # Simple Particle Swarm Optimization (PSO) with Python # July, 2016 # #…
1
vote
0 answers

How to Implement PSO to SVM?

I am doing my project using SVM classification for sentiment analysis. can I implement Particle Swarm Optimization into my project? and how xD here some code on my project using jupyter Train_X, Test_X, Train_Y, Test_Y =…
Kurniawan
  • 11
  • 2
1
vote
0 answers

how to find Particle swarm optimization (PSO) fitness function in R programming?

I'm new to Machine Learning, so kindly ask for more details if required or do point me towards the resources I should read to have a better understanding. Lets say I have a data set consisting of these columns "A" "B" "C" "D" "Target" Target column…
rahul shah
  • 11
  • 2
1
vote
0 answers

i am having a problem with pygmo software

i have installed the pygmo software via conda prompt. and while running . the following error appeared. how can i fix my installation in ----> 1 from pygmo import * 2 from pygmo import * 3 import…
omar Elfarouk
  • 63
  • 1
  • 6
1
vote
0 answers

TypeError: string indices must be integers. Dont know what im doing wrong

I have a dataset with two columns the one identifies whether an email is classified as spam or not and the other column shows the emails content. ive been trying to implement naive bayes with PSO as well as ABC. However I get the error TypeError:…
1
vote
0 answers

pso algorithm on test function. But I'm stuck with python code

So I have to classes Swarm and Particles, and a class for Sphere function. But when I'm trying to run the optimization, I get error on iteretation and I don't understand why: TypeError: '<' not supported between instances of 'NoneType' and…
DsTel
  • 11
  • 1
1
vote
0 answers

How to use Particle swarm optimization function (particleswarm) in MATLAB and why is my best function value shows an inf value?

I am new to MATLAB and making a project on Path Planning on a 3D environment with PSO. I managed to write my main function as : clc; close all; MaxIt = 100; noOfPointsInSolution = 1 ; n=(noOfPointsInSolution + 1) / 2 ; options =…
3kka-abhi
  • 11
  • 1
1
vote
0 answers

How to apply a bootstrap function on a Particle Swarm Optimisation Algorithm

I am currently trying to use the Particle Swarm Optimisation to find out the optimum value of two variables. This is my code f = @(x)per_dif(adam_im,adam_count,x(1),x(2)); %FUNCTION lb = [0.5,1]; %LOWER BOUND ub = [1,20]; %UPPER BOUND x =…
1
vote
2 answers

Reshaping numpy arrays of differing dimensions inside an array

So the task is to optimise a Neural Network with a PSO. The PSO needs a one-dimensional list of all the weights and biases, like so [0.1 0.244 ... 0.214]. The NN needs an array of arrays with different dimensions, like so [[x,y], [m,n], ...(all the…
eddie evt
  • 59
  • 7
1
vote
1 answer

I am using SVR() function for regression. I am unable to optimize it's parameter using #pso by #Pyswarm

Optimizing parameters of #SVR() using #pyswarm #PSO function. I have 200 inputs of the dataset with 9 features of each input. I have to predict one output parameter. I already did it by calling using #SVR() function using it's default parameters.…
Muhammad Shahzad
  • 381
  • 1
  • 3
  • 13
1
vote
1 answer

Is there a adaptable algorithm(or code) for multiple parameters optimizatin in python?

I'm making a multiple parameters optimization tool for a simulator in python. I have 7 parameters and with changing the parameters, the 5 result items change. (each parameter has different boundary.) I dont know the simulator's eqaution. So, I think…
1 2
3
11 12