nnaisense / evotorch

Advanced evolutionary computation library built directly on top of PyTorch, created at NNAISENSE.
https://evotorch.ai
Apache License 2.0
1.01k stars 63 forks source link

feat: Improve GeneticAlgorithm and add MAPElites #44

Closed engintoklu closed 1 year ago

engintoklu commented 1 year ago

This pull request aims to improve the API related to genetic algorithm and its operators. The improvements are as follows:

Co-authored-by: Nihat Engin Toklu engin@nnaisense.com Co-authored-by: Pawel Liskowski pawel@nnaisense.com

codecov-commenter commented 1 year ago

Codecov Report

Merging #44 (0f35c54) into master (b92d9bb) will increase coverage by 0.71%. The diff coverage is 78.14%.

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   77.05%   77.77%   +0.71%     
==========================================
  Files          47       49       +2     
  Lines        6533     7319     +786     
==========================================
+ Hits         5034     5692     +658     
- Misses       1499     1627     +128     
Impacted Files Coverage Δ
src/evotorch/core.py 74.48% <0.00%> (+0.84%) :arrow_up:
src/evotorch/algorithms/ga.py 66.85% <57.14%> (+3.63%) :arrow_up:
src/evotorch/tools/structures.py 79.50% <79.50%> (ø)
src/evotorch/algorithms/mapelites.py 83.69% <83.69%> (ø)
src/evotorch/tools/misc.py 86.36% <90.00%> (+0.09%) :arrow_up:
src/evotorch/operators/real.py 93.00% <91.93%> (+11.39%) :arrow_up:
src/evotorch/algorithms/__init__.py 100.00% <100.00%> (ø)
src/evotorch/operators/__init__.py 100.00% <100.00%> (ø)
src/evotorch/tools/__init__.py 100.00% <100.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

NaturalGradient commented 1 year ago

I've gone through the code and I'm generally happy. My only request is that maybe we can add an example that uses MAPElites? Although this could be added in a separate PR, I would appreciate a 'sensible use case' of the algorithm to play around with + verify it @engintoklu @pliskowski