polarcbo.dynamic.PolarCBO

class polarcbo.dynamic.PolarCBO(x, V, noise, beta=1.0, noise_decay=0.0, diff_exp=1.0, tau=0.1, sigma=1.0, lamda=1.0, M=None, overshoot_correction=False, heavi_correction=False, kernel=<polarcbo.functional.Gaussian_kernel object>)[source]

Bases: ParticleDynamic

Polarized CBO class

This class implements the polarized consensus-based optimization (PolarCBO) algorithm as described in [1]. The algorithm is a polarized version of the consensus-based optimization (CBO) algorithm [2].

Parameters:
  • x (array_like) – The initial positions of the particles. The shape of the array should be (num_particles, num_dimensions).

  • V (obejective) – The objective function \(V(x)\) of the system.

  • beta (float, optional) – The heat parameter \(\beta\) of the system. The default is 1.0.

  • noise (noise_model, optional) – The noise model that is used to compute the noise vector. The default is normal_noise(tau=0.1).

  • noise_decay (float, optional) – The decay parameter \(\lambda\) of the noise model. The default is 0.0.

  • diff_exp (float, optional) – The exponent \(\alpha\) of the difference vector \(x_i - \mathsf{m}(x_i)\). The default is 1.0.

  • tau (float, optional) – The time constant \(\tau\) of the noise model. The default is 0.1.

  • sigma (float, optional) – The standard deviation \(\sigma\) of the noise model. The default is 1.0.

  • lamda (float, optional) – The overshoot parameter \(\lambda\) of the algorithm. The default is 1.0.

  • M (int, optional) – The number of particles that are used to compute the batch mean \(\mathsf{m}(x_i)\). The default is None.

  • overshoot_correction (bool, optional) – If True, the overshoot correction is applied. The default is False.

  • heavi_correction (bool, optional) – If True, the Heaviside correction is applied. The default is False.

  • kernel (object, optional) – The kernel function \(K(x_i, x_j)\) that is used to compute the mean \(\mathsf{m}(x_i)\). The default is Gaussian_kernel().

References

step(time=0.0)[source]

Step of the PolarCBO algorithm.

Parameters:

time (float, optional) – The current time of the simulation. The default is 0.0.

Return type:

None.

compute_mean(ind=None)[source]

Compute the mean \(\mathsf{m}(x_i)\) of the particles.

Parameters:

ind (array_like, optional) –

Returns:

m_beta – The mean \(\mathsf{m}(x_i)\) of the particles.

Return type:

array_like