From dd3c9accb2eb47a69467aeebe3519fdd79568712 Mon Sep 17 00:00:00 2001 From: Shaad Alaka Date: Tue, 16 Jun 2020 12:58:00 +0200 Subject: [PATCH 1/2] 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 --- pyswarms/discrete/binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyswarms/discrete/binary.py b/pyswarms/discrete/binary.py index 7ae5bc8b..18688ad0 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 From e4c4426bb69ce104bc9f9523a2a99c7b0aa10784 Mon Sep 17 00:00:00 2001 From: Shaad Alaka Date: Tue, 16 Jun 2020 13:24:22 +0200 Subject: [PATCH 2/2] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyswarms/discrete/binary.py b/pyswarms/discrete/binary.py index 18688ad0..ed20b8f3 100644 --- a/pyswarms/discrete/binary.py +++ b/pyswarms/discrete/binary.py @@ -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