Particle Swarm Optimization
Manopt.particle_swarm
— Functionpatricle_swarm(M, F)
perform the particle swarm optimization algorithm (PSO), starting with the initial particle positions $x_0$[Borckmans2010]. The aim of PSO is to find the particle position $g$ on the Manifold M
that solves
To this end, a swarm of particles is moved around the Manifold M
in the following manner. For every particle $k$ we compute the new particle velocities $v_k^{(i)}$ in every step $i$ of the algorithm by
where $x_k^{(i)}$ is the current particle position, $\omega$ denotes the inertia, $c$ and $s$ are a cognitive and a social weight, respectively, $r_j$, $~j=1,2$ are random factors which are computed new for each particle and step, $\operatorname{retr}^{-1}$ denotes an inverse retraction on the Manifold
M
, and $\operatorname{T}$ is a vector transport.
Then the position of the particle is updated as
where $\operatorname{retr}$ denotes a retraction on the Manifold
M
. At the end of each step for every particle, we set
and
i.e. $p_k^{(i)}$ is the best known position for the particle $k$ and $g^{(i)}$ is the global best known position ever visited up to step $i$.
Input
M
– a manifold $\mathcal M$F
– a cost function $F\colon\mathcal M\to\mathbb R$ to minimize
Optional
n
- (100
) number of random initial positions of x0x0
– the initial positions of each particle in the swarm $x_k^{(0)} ∈ \mathcal M$ for $k = 1, \dots, n$, per default these are nrandom_point
svelocity
– a set of tangent vectors (of typeAbstractVector{T}
) representing the velocities of the particles, per default arandom_tangent
per inital positioninertia
– (0.65
) the inertia of the patriclessocial_weight
– (1.4
) a social weight factorcognitive_weight
– (1.4
) a cognitive weight factorretraction_method
– (ExponentialRetraction()
) aretraction(M,x,ξ)
to use.inverse_retraction_method
- (LogarithmicInverseRetraction()
) aninverse_retraction(M,x,y)
to use.vector_transport_mthod
- (ParallelTransport()
) a vector transport method to use.stopping_criterion
– (StopWhenAny
(
StopAfterIteration
(500)
,StopWhenChangeLess
(10^{-4})))
a functor inheriting fromStoppingCriterion
indicating when to stop.return_options
– (false
) – if activated, the extended result, i.e. the completeOptions
are returned. This can be used to access recorded values. If set to false (default) just the optimal valuex_opt
if returned
... and the ones that are passed to decorate_options
for decorators.
Output
g
– the resulting point of PSO
OR
options
- the options returned by the solver (seereturn_options
)
Manopt.particle_swarm!
— Functionpatricle_swarm!(M, F; n=100, x0::AbstractVector=[random_point(M) for i in 1:n], kwargs...)
perform the particle swarm optimization algorithm (PSO), starting with the initial particle positions $x_0$[Borckmans2010] in place of x0
.
Input
M
– a manifold $\mathcal M$F
– a cost function $F\colon\mathcal M\to\mathbb R$ to minimize
Optional
n
- (100
) number of random initial positions of x0x0
– the initial positions of each particle in the swarm $x_k^{(0)} ∈ \mathcal M$ for $k = 1, \dots, n$, per default these are nrandom_point
s
for more optional arguments, see particle_swarm
.
Options
Manopt.ParticleSwarmOptions
— TypeParticleSwarmOptions{P,T} <: Options
Describes a particle swarm optimizing algorithm, with
Fields
a default value is given in brackets if a parameter can be left out in initialization.
x0
– a set of points (of typeAbstractVector{P}
) on a manifold as initial particle positionsvelocity
– a set of tangent vectors (of typeAbstractVector{T}
) representing the velocities of the particlesinertia
– (0.65
) the inertia of the patriclessocial_weight
– (1.4
) a social weight factorcognitive_weight
– (1.4
) a cognitive weight factorstopping_criterion
– (StopWhenAny
(
StopAfterIteration
(500)
,StopWhenChangeLess
(10^{-4})))
a functor inheriting fromStoppingCriterion
indicating when to stop.retraction_method
– (ExponentialRetraction
) the rectraction to useinverse_retraction_method
- (LogarithmicInverseRetraction
) an inverse retraction to use.
Constructor
ParticleSwarmOptions(x0, velocity, inertia, social_weight, cognitive_weight, stopping_criterion[, retraction_method=ExponentialRetraction(), inverse_retraction_method=LogarithmicInverseRetraction()])
construct a particle swarm Option with the fields and defaults as above.
See also
Literature
- Borckmans2010
P. B. Borckmans, M. Ishteva, P.-A. Absil, A Modified Particle Swarm Optimization Algorithm for the Best Low Multilinear Rank Approximation of Higher-Order Tensors, In: Dorigo M. et al. (eds) Swarm Intelligence. ANTS 2010. Lecture Notes in Computer Science, vol 6234. Springer, Berlin, Heidelberg, doi 10.1007/978-3-642-15461-4_2