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: Add a functional API for optimization #98

Closed engintoklu closed 4 months ago

engintoklu commented 9 months ago

This pull request introduces an alternative API for EvoTorch that conforms to the functional programming paradigm. This functional API can be used together with torch.func.vmap, and therefore can be used for optimizing not just a single population, but a batch of populations simultaneously.

The main improvements are:

codecov[bot] commented 8 months ago

Codecov Report

Attention: 113 lines in your changes are missing coverage. Please review.

Comparison is base (5c58566) 76.74% compared to head (8224905) 77.36%.

Files Patch % Lines
src/evotorch/distributions.py 80.79% 34 Missing :warning:
src/evotorch/core.py 31.42% 24 Missing :warning:
src/evotorch/algorithms/functional/misc.py 67.50% 13 Missing :warning:
src/evotorch/tools/misc.py 78.43% 11 Missing :warning:
src/evotorch/algorithms/functional/funcpgpe.py 89.53% 9 Missing :warning:
src/evotorch/algorithms/functional/funccem.py 87.50% 8 Missing :warning:
src/evotorch/tools/constraints.py 87.30% 8 Missing :warning:
src/evotorch/algorithms/functional/funcclipup.py 92.50% 3 Missing :warning:
src/evotorch/decorators.py 96.25% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #98 +/- ## ========================================== + Coverage 76.74% 77.36% +0.61% ========================================== Files 49 57 +8 Lines 7509 8213 +704 ========================================== + Hits 5763 6354 +591 - Misses 1746 1859 +113 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.