RobertTLange / evosax

Evolution Strategies in JAX 🦎
Apache License 2.0
475 stars 44 forks source link

Ensure elite population is at least 1 where applicable #30

Closed nhansendev closed 1 year ago

nhansendev commented 1 year ago

Per Issue #29 the __init__ of the following strategies have been updated to ensure the elite population size is >= 1:

Ex: self.elite_popsize = int(self.popsize * self.elite_ratio) becomes: self.elite_popsize = max(1, int(self.popsize * self.elite_ratio))

codecov-commenter commented 1 year ago

Codecov Report

Merging #30 (3f930f3) into main (371aa39) will not change coverage. The diff coverage is 100.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/RobertTLange/evosax/pull/30/graphs/tree.svg?width=650&height=150&src=pr&token=5FUSX35KWO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange)](https://codecov.io/gh/RobertTLange/evosax/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange) ```diff @@ Coverage Diff @@ ## main #30 +/- ## ======================================= Coverage 88.88% 88.88% ======================================= Files 60 60 Lines 3211 3211 ======================================= Hits 2854 2854 Misses 357 357 ``` | [Impacted Files](https://codecov.io/gh/RobertTLange/evosax/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange) | Coverage Δ | | |---|---|---| | [evosax/strategies/ars.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvYXJzLnB5) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/cma\_es.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvY21hX2VzLnB5) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/full\_iamalgam.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvZnVsbF9pYW1hbGdhbS5weQ==) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/indep\_iamalgam.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvaW5kZXBfaWFtYWxnYW0ucHk=) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/lm\_ma\_es.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvbG1fbWFfZXMucHk=) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/ma\_es.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvbWFfZXMucHk=) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/pgpe.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvcGdwZS5weQ==) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/rm\_es.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvcm1fZXMucHk=) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/sep\_cma\_es.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvc2VwX2NtYV9lcy5weQ==) | `100.00% <100.00%> (ø)` | | | [evosax/strategies/simple\_es.py](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange#diff-ZXZvc2F4L3N0cmF0ZWdpZXMvc2ltcGxlX2VzLnB5) | `100.00% <100.00%> (ø)` | | | ... and [1 more](https://codecov.io/gh/RobertTLange/evosax/pull/30/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Robert+Lange) | |
RobertTLange commented 1 year ago

Awesome! Thank you so much @Obliman