-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #390 from AlesGartner/lshade
L-SHADE implementation
- Loading branch information
Showing
7 changed files
with
637 additions
and
7 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# encoding=utf8 | ||
# This is temporary fix to import module from parent folder | ||
# It will be removed when package is published on PyPI | ||
import sys | ||
|
||
sys.path.append('../') | ||
# End of fix | ||
|
||
from niapy.algorithms.modified import SuccessHistoryAdaptiveDifferentialEvolution | ||
from niapy.task import Task | ||
from niapy.problems import Griewank | ||
|
||
# we will run SHADE algorithm for 5 independent runs | ||
algo = SuccessHistoryAdaptiveDifferentialEvolution(population_size=20, extern_arc_rate=2.0, pbest_factor=0.2, | ||
hist_mem_size=5) | ||
for i in range(5): | ||
task = Task(problem=Griewank(dimension=10, lower=-600, upper=600), max_evals=10000, enable_logging=True) | ||
best = algo.run(task) | ||
print('%s -> %s' % (best[0], best[1])) | ||
print(algo.get_parameters()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.