From ea9de0498115e1fd328115c0e15f527d5feb7cb9 Mon Sep 17 00:00:00 2001 From: Shaad Alaka Date: Wed, 17 Jun 2020 04:42:54 +0200 Subject: [PATCH] Fix doc typos in binary discrete optimizer module (pyswarms.discrete.binary) (#409) * Fix typo in formula: 'm' --> 'w' Since 'm' wasn't defined anywhere, I assumed the inertia 'w' was actually meant here, similar to the formula for the real-valued algorithm * Add missing 'w' entry in `options` dict keyword argument in doc for BinaryPSO init The 'w' key was missing in the `options` dictionary, but was described below in the list (and is used in the code as well). --- pyswarms/discrete/binary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyswarms/discrete/binary.py b/pyswarms/discrete/binary.py index 7ae5bc8b..ed20b8f3 100644 --- a/pyswarms/discrete/binary.py +++ b/pyswarms/discrete/binary.py @@ -14,7 +14,7 @@ .. math:: - v_{ij}(t + 1) = m * v_{ij}(t) + c_{1}r_{1j}(t)[y_{ij}(t) − x_{ij}(t)] + c_{2}r_{2j}(t)[\hat{y}_{j}(t) − x_{ij}(t)] + v_{ij}(t + 1) = w * v_{ij}(t) + c_{1}r_{1j}(t)[y_{ij}(t) − x_{ij}(t)] + c_{2}r_{2j}(t)[\hat{y}_{j}(t) − x_{ij}(t)] For the velocity update rule, a particle compares its current position with respect to its neighbours. The nearest neighbours are being @@ -87,7 +87,7 @@ def __init__( number of particles in the swarm. dimensions : int number of dimensions in the space. - options : dict with keys :code:`{'c1', 'c2', 'k', 'p'}` + options : dict with keys :code:`{'c1', 'c2', 'w', 'k', 'p'}` a dictionary containing the parameters for the specific optimization technique * c1 : float