ribs.emitters.rankers.NoveltyRanker

class ribs.emitters.rankers.NoveltyRanker(seed: int | integer | None = None)[source]

Ranks solutions based on novelty scores.

This ranker can only be used with archives that return the novelty field from their add method, such as ribs.archives.ProximityArchive.add().

Methods

rank(emitter, archive, data, add_info)

Ranks solutions based on novelty scores.

reset(emitter, archive)

Resets the internal state of the ranker.

rank(emitter: EmitterBase, archive: ArchiveBase, data: dict[str, ndarray], add_info: dict[str, ndarray]) tuple[ndarray, ndarray][source]

Ranks solutions based on novelty scores.

Parameters:
emitter: EmitterBase

Emitter that this ranker object belongs to.

archive: ArchiveBase

Archive used by emitter when creating and inserting solutions.

data: dict[str, ndarray]

Dict mapping from field names like solution and objective to arrays with data for the solutions.

add_info: dict[str, ndarray]

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 and n_values is the number of values that the rank function used.

reset(emitter: EmitterBase, archive: ArchiveBase) None

Resets the internal state of the ranker.

Parameters:
emitter: EmitterBase

Emitter that this ranker object belongs to.

archive: ArchiveBase

Archive used by emitter when creating and inserting solutions.