pygsti.optimize.fmin_particle_swarm¶
-
pygsti.optimize.
fmin_particle_swarm
(f, x0, err_crit, iter_max, popsize=100, c1=2, c2=2)¶ A simple implementation of the Particle Swarm Optimization Algorithm. Pradeep Gowda 2009-03-16
Parameters: - f (function) – The function to minimize.
- x0 (numpy array) – The starting point (argument to fn).
- err_crit (float) – Critical error (i.e. tolerance). Stops when error < err_crit.
- iter_max (int) – Maximum iterations.
- popsize (int, optional) – Population size. Larger populations are better at finding the global optimum but make the algorithm take longer to run.
- c1 (float, optional) – Coefficient describing a particle’s affinity for it’s (local) maximum.
- c2 (float, optional) – Coefficient describing a particle’s affinity for the best maximum any particle has seen (the current global max).
Returns: Includes members ‘x’, ‘fun’, ‘success’, and ‘message’.
Return type: scipy.optimize.Result object