-
Notifications
You must be signed in to change notification settings - Fork 30
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
Introduced the Ranker object, responsible for ranking the solutions based on different objectives #209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change. I also tweaked get_ranker
.
ribs/emitters/rankers.py
Outdated
@@ -59,44 +77,27 @@ class RankerBase(ABC): | |||
Child classes are only required to override :meth:`rank`. | |||
""" | |||
|
|||
def __init__(self, seed=None): | |||
pass | |||
|
|||
@abstractmethod | |||
def rank(self, emitter, archive, solution_batch, objective_batch, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put rng
after archive
so that the signature is similar to reset
?
…bs into add-rankers-emitters-api
Description
This PR is a split from #207
This PR introduces major API changes for the
Emitter
class.Emitter
class now requires aRanker
object and aSelector
object.The
Ranker
object will define arank
function which returns the index of the solutions in the descending order that they should be in. It will also define areset
function which resets the internal states of the object.RandomDirectionEmitter
,OptimizingEmitter
, andImprovementEmitter
are now all combined intoEvolutionStrategyEmitter
, which can be configured to use differentRanker
's.We also introduce
FilterSelector
andMuSelector
objects which defines aselect()
function that decides how many parents to select from the potential parents.EvolutionStrategyEmitter(x0, sigma0, ranker=Ranker, string, selector, ES, restart_rule, bounds, batch_size, seed)
If ranker=str, then we create the object for you
TODO
ImprovementRanker
TwoStageImprovementRanker
RandomDirectionRanker
TwoStageRandomDirectionRanker
ObjectiveRanker
TwoStageObjectiveRanker
get_ranker(str) -> Ranker
Others
Status
yapf
pytest
pylint
HISTORY.md
.