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

Add visualization of QDax repertoires #353

Merged
merged 2 commits into from
Sep 7, 2023
Merged

Add visualization of QDax repertoires #353

merged 2 commits into from
Sep 7, 2023

Conversation

btjanaka
Copy link
Member

@btjanaka btjanaka commented Sep 5, 2023

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

  • Write/document function
  • Add tests in tests/visualize_qdax
  • Set up CI for testing qdax visualization

Questions

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

Copy link
Collaborator

@itsdawei itsdawei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@btjanaka btjanaka merged commit 25dc442 into master Sep 7, 2023
18 checks passed
@btjanaka btjanaka deleted the visualize-qdax branch September 7, 2023 01:37
btjanaka added a commit that referenced this pull request Sep 14, 2023
## Description

<!-- Provide a brief description of the PR's purpose here. -->

Similar to #353 that introduced `qdax_repertoire_heatmap`, this PR
introduces `qdax_repertoire_3d_plot` for using `cvt_archive_3d_plot`
from #371 to visualize QDax repertoires with 3D measure space.

## TODO

<!-- Notable points that this PR has either accomplished or will
accomplish. -->

- [x] Implement
- [x] Test
- [x] Refactor to put all qdax vis in one file

## Questions

<!-- Any concerns or points of confusion? -->

## Status

- [x] I have read the guidelines in

[CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md)
- [x] I have formatted my code using `yapf`
- [x] I have tested my code by running `pytest`
- [x] I have linted my code with `pylint`
- [x] I have added a one-line description of my change to the changelog
in
      `HISTORY.md`
- [x] This PR is ready to go
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.

2 participants