-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,340 additions
and
527 deletions.
There are no files selected for viewing
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,5 @@ | ||
# ACKNOWLEDGEMENTS | ||
|
||
## Contributors | ||
|
||
Thomas Hopkins, Rensselaer Polytechnic Institute |
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
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
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
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,43 @@ | ||
""" | ||
This is the simplest example of using LEAP, where one can rely on the | ||
very high-level function, ea_solve(), to optimize the given real-valued | ||
function. | ||
This differs from simple.py in that we use parallel evaluations, which is | ||
as simple as passing in a dask Client for the `dask_client` argument. | ||
""" | ||
import os | ||
|
||
from distributed import Client | ||
|
||
from leap_ec import test_env_var | ||
from leap_ec.simple import ea_solve | ||
|
||
# When running the test harness, just run for two generations | ||
# (we use this to quickly ensure our examples don't get bitrot) | ||
if os.environ.get(test_env_var, False) == 'True': | ||
generations = 2 | ||
viz = False | ||
else: | ||
generations = 100 | ||
viz = True | ||
|
||
|
||
############################## | ||
# Fitness function | ||
############################## | ||
def function(values): | ||
"""A simple fitness function, evaluating the sum of squared parameters.""" | ||
return sum([x ** 2 for x in values]) | ||
|
||
|
||
############################## | ||
# Entry point | ||
############################## | ||
if __name__ == '__main__': | ||
ea_solve(function, | ||
generations=generations, | ||
bounds=[(-5.12, 5.12) for _ in range(5)], | ||
viz=viz, | ||
mutation_std=0.1, | ||
dask_client=Client()) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.6.0" | ||
__version__ = "0.7.0" |
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.