Skip to content

Commit 68b9809

Browse files
Merge branch 'master' of github.com:KernelTuner/kernel_tuner into fix-issue-314
2 parents b3b94ec + 552973d commit 68b9809

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ tornado==6.5.1 ; python_version >= "3.9" and python_version < "3.15"
8282
traitlets==5.14.3 ; python_version >= "3.9" and python_version < "3.15"
8383
typing-extensions==4.12.2 ; python_version >= "3.9" and python_version < "3.15"
8484
tzdata==2025.1 ; python_version >= "3.9" and python_version < "3.15"
85-
urllib3==2.3.0 ; python_version >= "3.9" and python_version < "3.15"
85+
urllib3==2.5.0 ; python_version >= "3.9" and python_version < "3.15"
8686
wcwidth==0.2.13 ; python_version >= "3.9" and python_version < "3.15"
8787
webencodings==0.5.1 ; python_version >= "3.9" and python_version < "3.15"
8888
xmltodict==0.14.2 ; python_version >= "3.9" and python_version < "3.15"

kernel_tuner/strategies/firefly_algorithm.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(self, bounds):
9494
"""Create Firefly at random position within bounds."""
9595
super().__init__(bounds)
9696
self.bounds = bounds
97-
self.intensity = 1 / self.score
97+
self.intensity = -self.score
9898

9999
def distance_to(self, other):
100100
"""Return Euclidian distance between self and other Firefly."""
@@ -103,10 +103,7 @@ def distance_to(self, other):
103103
def compute_intensity(self, fun):
104104
"""Evaluate cost function and compute intensity at this position."""
105105
self.evaluate(fun)
106-
if self.score == sys.float_info.max:
107-
self.intensity = -sys.float_info.max
108-
else:
109-
self.intensity = 1 / self.score
106+
self.intensity = -self.score
110107

111108
def move_towards(self, other, beta, alpha):
112109
"""Move firefly towards another given beta and alpha values."""

0 commit comments

Comments
 (0)