Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Evolution Strategy Emitter #220

Merged
merged 26 commits into from Jun 29, 2022
Merged

Implement Evolution Strategy Emitter #220

merged 26 commits into from Jun 29, 2022

Conversation

itsdawei
Copy link
Collaborator

@itsdawei itsdawei commented Jun 24, 2022

Description

This PR is a split from #207

This PR introduces major API changes for the Emitter class. Emitter class now requires a Ranker object and a Selector object.

The Ranker object will define a rank function which returns the index of the solutions in the descending order that they should be in. It will also define a reset function which resets the internal states of the object.

We also introduce FilterSelector and MuSelector objects which defines a select() function that decides how many parents to select from the potential parents.

Introduced EvolutionStrategyEmitter(x0, sigma0, ranker, restart_rule, bounds, batch_size, seed), which can serve as
RandomDirectionEmitter, OptimizingEmitter, and ImprovementEmitter depending on the ranker object.

Bugs Discovered

  • We passed in the same RandomDirectionRanker to the emitters in sphere example, causing the emitter to fail because the ranker is supposed to maintain different random directions.
  • RandomDirectionRanker was sorting the solutions using the wrong keys.

TODO

  • Implement EvolutionStrategyEmitter
  • Pytest
  • Test examples/sphere
  • Sphinx docs
  • Fix bugs that we discovered
  • Describe bugs discovered (see above)

Status

  • I have read the guidelines in CONTRIBUTING.md.
  • I have formatted my code using yapf
  • I have tested my code by running pytest
  • I have linted my code with pylint
  • I have added a one-line description of my change to the changelog in HISTORY.md.
  • This PR is ready to go

@itsdawei itsdawei requested a review from btjanaka June 24, 2022 21:32
@itsdawei itsdawei self-assigned this Jun 24, 2022
examples/sphere.py Outdated Show resolved Hide resolved
examples/sphere.py Outdated Show resolved Hide resolved
ribs/emitters/rankers.py Outdated Show resolved Hide resolved
tests/emitters/rankers_test.py Outdated Show resolved Hide resolved
@itsdawei
Copy link
Collaborator Author

itsdawei commented Jun 28, 2022

For reference, we are gonna leave a table that shows the performance (archive coverage, QD score, and time) of the previous implementation using different emitters and the new implementation that adapts a emitter-ranker structure (using only the evolution_strategy_emitter).

Algorithm New Implementation Old Implementation
cma_me_imp 91.050%, 17390451 QD, 141s 91.072%, 17475874 QD, 102s
cma_me_imp_mu 94.098%, 17793410 QD, 140s 92.986%, 17683259 QD, 104s
cma_me_rd 97.362%, 15219340 QD, 120s 92.061%, 12029980 QD, 110s
cma_me_rd_mu 97.172%, 12869971 QD, 114s 95.455%, 11579076 QD, 107s
cma_me_opt 12.224%, 2542591 QD, 112s 12.495%, 2619242 QD, 96s
cma_me_mixed 95.640%, 17942995 QD, 109s 95.576%, 17841624 QD, 106s

We note that our new implementation has similar coverage and QD score compared to that of the old implementation. Hence, we justify that our new implementation is algorithmically equivalent to the old implementation.

@itsdawei itsdawei requested a review from btjanaka June 29, 2022 20:53
HISTORY.md Outdated Show resolved Hide resolved
@itsdawei itsdawei merged commit b4291e4 into master Jun 29, 2022
@itsdawei itsdawei deleted the implement-es-emitter branch June 29, 2022 21:59
@itsdawei itsdawei changed the title Implement es emitter Implement Evolution Strategy Emitter Jun 29, 2022
@btjanaka btjanaka mentioned this pull request Jul 22, 2022
14 tasks
@itsdawei itsdawei mentioned this pull request Aug 24, 2022
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants