ribs.emitters.rankers.TwoStageImprovementRanker¶
- class ribs.emitters.rankers.TwoStageImprovementRanker(seed=None)[source]¶
Ranks the solutions based on the improvement in the objective.
This ranker originates in Fontaine 2020 in which it was referred to as “Improvement Emitter”. This ranker ranks solutions in two stages. First, solutions are ranked by “status” – those that found a new cell in the archive rank above those that improved an existing cell, which rank above those that were not added to the archive. Second, solutions are ranked by the “value” described in
ribs.archives.ArchiveBase.add()
Methods
rank
(emitter, archive, data, add_info)Generates a list of indices that represents an ordering of solutions.
reset
(emitter, archive)Resets the internal state of the ranker.
- rank(emitter, archive, data, add_info)[source]¶
Generates a list of indices that represents an ordering of solutions.
- Parameters
emitter (ribs.emitters.EmitterBase) – Emitter that this
ranker
object belongs to.archive (ribs.archives.ArchiveBase) – Archive used by
emitter
when creating and inserting solutions.data (dict) – Dict mapping from field names like
solution
andobjective
to arrays with data for the solutions. Rankers at least assume the presence of thesolution
key.add_info (dict) – Information returned by an archive’s add() method.
- Returns
the first array (shape
(batch_size,)
) is an array of indices representing a ranking of the solutions and the second array (shape(batch_size,)
or (batch_size, n_values)``) is an array of values that this ranker used to rank the solutions.batch_size
is the number of solutions andn_values
is the number of values that the rank function used.- Return type
- reset(emitter, archive)¶
Resets the internal state of the ranker.
- Parameters
emitter (ribs.emitters.EmitterBase) – Emitter that this
ranker
object belongs to.archive (ribs.archives.ArchiveBase) – Archive used by
emitter
when creating and inserting solutions.