icaros-usc / pyribs

A bare-bones Python library for quality diversity optimization.
https://pyribs.org
MIT License
205 stars 31 forks source link

Add visualization of QDax repertoires #353

Closed btjanaka closed 10 months ago

btjanaka commented 10 months ago

Description

QDax’s repertoires are not too different from pyribs in terms of the data stored, which means our visualization tools can easily be used for both libraries. This PR makes it possible to visualize one of the main repertoires used in QDax, i.e., the MAPElitesRepertoire. The key idea is to transform the MAPElitesRepertoire into a CVTArchive and then plot the result with cvt_archive_heatmap. In this PR, this functionality is exposed via a new function, ribs.visualize.qdax_repertoire_heatmap. We update the tests and CI accordingly.

Note 1: This PR does not introduce a dependency on QDax for pyribs. If a QDax repertoire is passed into the method introduced here, it can be plotted, but we do not import qdax itself at any point.

Note 2: QDax does not have a separate grid archive. Instead, both grid and CVT archives from pyribs are represented with the MAPElitesRepertoire. Specifically, one can choose Euclidean centroids when constructing the repertoire in order to create a "grid archive."

TODO

Questions

Status