|
Algorithm 1. PSO-RBFN-SA |
|
|
prepared spectra are used as samples for RBFN training. |
| For
|
| PSO is performed to the spectrum
, and the population of particles is set as
. |
| For
|
|
represents the current solution, which is initialized as a random solution in the solution space:
|
|
represents the current velocity, which is initialized as a random velocity:
|
|
represents the best solution it has achieved so far, which is initialized as:
|
| End |
| The maximum iteration of PSO is set as
. |
| For
|
| The global best solution
is defined as:
|
| For
|
| The weighted particle velocity is updated as:
where
and
are two separate random number between 0 and 1, while
and
are acceleration constants, representing the weight of acceleration terms that pull each particle toward the local best solution and the global best solution.
is the inertia weight for balancing the global and local influences, which is defined as:
where
linearly decreases through the course of the run. A large inertia weight facilitates a global search while a small inertia weight facilitates a local search. Accordingly, the optimization process can converge to the neighborhood of global optimal solution smoothly at the prophase and converge to the global optimal solution quickly at the anaphase. |
| The solution of each particle is updated as:
|
| The best position of particle is calculated as:
|
| End |
| End |
| The global optimization result of
is recorded as
. |
| End |
| RBFN is trained with the optimization results, where the training inputs are defined as:
and the training outputs are defined as:
|
|
| The global optimization result of each online measured spectrum
is inferred by the constructed RBFN, where the input is set as:
|
| The output is calculated as:
where
is a basis function,
denotes the Euclidean norm,
is the weight in the output layer,
is the number of neurons in the hidden layer, and
is the center of RBF in the input vector space. SA is performed with the initial solution
, and the initial state
is defined as
. Initial temperature is set as
, and the maximum iteration of SA is set as
. |
| For
|
| The cooling condition is that the best state remains unchanged for
times. |
| While the cooling condition is not satisfied |
| Use a perturbation mechanism to generate a new state
:
where
is a normally distributed random number.
is defined as:
and () is defined with a random integer
in
:
|
| The decrease of fitness is:
|
| Check whether the new state should be accepted according to Metropolis criteria:
where
is Boltzmann constant and
is a random number in
. |
| End |
| Cool down with a parameter
:
|
| End |
| The result of
is returned to calculate multi-element concentrations. |