View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0028271||Open CASCADE||OCCT:Modeling Data||public||2016-12-23 11:53||2023-08-01 15:06|
|Summary||0028271: Remarks to math_PSO usability|
|Description||This is to share my experience with PSO tool from math.|
1a) It is not clear how to distribute particles. I was expecting that particles follow uniform distribution by default in the search space, but this does not happen. The client code is bothered with the necessity of such distribution. I understand that in some cases (like extrema) the distribution of particles is dictated by the specifics of an objective function. But for a general purpose we should follow  (since we refer to this work in the comments).
1b) Even if the user is forced to distribute particles manually, just assigning positions to them is not enough. It is also required to initialize BestPosition which is a bit weird (see code snippet below).
1c) If we had a default distribution strategy for particles, then, I guess, we can have a default instance of math_PSOParticlesPool structure not to bother the client code with creating it.
To summarize 1a), 1b), and 1c), we lack default initialization strategy for particles, don't we?
2) Each particle stores the best function value in "Distance" field. "Distance" keyword cannot be used since PSO is abstract, and the extrema is just one of its application. "Fitness" and "BestFitness" are better terms.
3) I failed to understand the meaning of the following arguments in PSO:
- const math_Vector& theSteps (ctor).
- Standard_Real& theValue (Perform() method).
It required digging into the code to clarify what is "theValue" and "theSteps". Probably, "theSteps" can be made optional? Notice that if "theSteps" is used for termination, then there is some strange calibration in the code "aTerminationVelocity = mySteps / 2048.0" which looks pretty unclear.
4) Why PSO_Particle uses double* and not math_Vector? It seems to be inconsistent with the signature of PSO.
5) Why the weights of social and cognitive determinants are hard-coded? My experiments show that with such values PSO may diverge in terms of particle locations (not all particles sit in the same minimum). I wanted to adjust these weights, but it is not possible.
Example (showing how tricky it is to run minimization for y = f(x)):
// Number of particles
const int numParticles = 30;
math_Vector xMin(1, 1), xMax(1, 1);
xMin(1) = 0.0;
xMax(1) = 100.0;
math_Vector xStep(1, 1), xDelta(1, 1);
xStep = (xMax - xMin)*0.01;
xDelta = (xMax - xMin)/numParticles;
// Structure which stores and manages particles
math_PSOParticlesPool psoPool(numParticles, 1);
// Choose initial positions for particles
for ( int i = 0; i < numParticles; ++i )
math_Vector x = xMin + i*xDelta;
PSO_Particle* pParticle = psoPool.GetParticle(i + 1);
pParticle->Position = x(1);
pParticle->BestPosition = pParticle->Position;
// Prepare objective function
math_Vector xOut(1, 1);
// Run optimization
math_PSO PSO(&objFunc, xMin, xMax, xStep);
PSO.Perform(psoPool, numParticles, value, xOut);
 Vaz, Vicente. A particle swarm pattern search method for bound constrained global optimization // Journal of Global Optimization. 2007
|Tags||No tags attached.|
|Test case number|
||Assigned To||=> msv|
||Target Version||7.2.0 => 7.3.0|
||Target Version||7.3.0 => 7.4.0|
||Target Version||7.4.0 => 7.5.0|
||Target Version||7.5.0 => 7.6.0|
||Target Version||7.6.0 => 7.7.0|
||Target Version||7.7.0 => 7.8.0|
|2023-08-01 15:06||dpasukhi||Target Version||7.8.0 => Unscheduled|