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 pyribs visualization #191

Merged
merged 12 commits into from
Dec 12, 2024
Merged

Add pyribs visualization #191

merged 12 commits into from
Dec 12, 2024

Conversation

btjanaka
Copy link
Contributor

@btjanaka btjanaka commented Dec 2, 2024

Contributor Agreements

Please read the contributor agreements and if you agree, please click the checkbox below.

  • I agree to the contributor agreements.

Tip

Please follow the Quick TODO list to smoothly merge your PR.

Motivation

This PR creates a plugin that provides wrappers for pyribs visualization tools. Currently, the plugin only supports the grid_archive_heatmap function from pyribs, which is sufficient for plotting the results from CmaMaeSampler.

Description of the changes

  • Created a new visualization plugin under visualization/plot_pyribs
  • Added a new function to the plugin called plot_grid_archive_heatmap, which is a wrapper around ribs.visualize.grid_archive_heatmap from pyribs.

TODO List towards PR Merge

Please remove this section if this PR is not an addition of a new package.
Otherwise, please check the following TODO list:

  • Copy ./template/ to create your package
  • Replace <COPYRIGHT HOLDER> in LICENSE of your package with your name
  • Fill out README.md in your package
  • Add import statements of your function or class names to be used in __init__.py
  • (Optional) Add from __future__ import annotations at the head of any Python files that include typing to support older Python versions
  • Apply the formatter based on the tips in README.md
  • Check whether your module works as intended based on the tips in README.md

@btjanaka
Copy link
Contributor Author

btjanaka commented Dec 2, 2024

Hi @nabenabe0928, I have added the visualization tools for plotting results from the CMA-MAE sampler. Would you take a look and let me know your thoughts? Thank you!


A minimal example would be the following:

```python
Copy link
Contributor Author

@btjanaka btjanaka Dec 2, 2024

Choose a reason for hiding this comment

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

@nabenabe0928 Do you think I should put this visualization example in the CMA-MAE sampler documentation too?

@nabenabe0928
Copy link
Contributor

@btjanaka

Hey, thank you for the PR!
I will take a look at your PR asap and merge this feature!

Do you think I should put this visualization example in the CMA-MAE sampler documentation too?

It's up to you, but I think it would increase the in-flow of users to this visualization module if we have the example!

@@ -27,6 +27,9 @@ with improvement ranking, all wrapped up in a
However, it is possible to implement many variations of CMA-MAE and other
quality diversity algorithms using pyribs.

For visualizing the results of the `CmaMaeSampler`, note that we use the
`plot_grid_archive_heatmap` function from the `plot_pyribs` plugin.
Copy link
Contributor Author

@btjanaka btjanaka Dec 2, 2024

Choose a reason for hiding this comment

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

@nabenabe0928 What is the correct way to link between plugins in the OptunaHub documentation? i.e., How can I provide a link to the plot_pyribs plugin here? Similarly, in the plot_pyribs plugin, I want to provide a link to the CmaMaeSampler.

Copy link
Contributor

Choose a reason for hiding this comment

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

I will quickly merge this PR, so you can surely open another PR later, but basically, the URL for each package is published like this, so you could link these URLs to your package!

@nabenabe0928
Copy link
Contributor

@btjanaka Hey sorry for the late response!
I was away from the development for a week and came back today!

Copy link
Contributor

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

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

After I verify the behavior of your code, I will merge this PR!
Please link the URLs to the corresponding locations in another PR:)

@@ -27,6 +27,9 @@ with improvement ranking, all wrapped up in a
However, it is possible to implement many variations of CMA-MAE and other
quality diversity algorithms using pyribs.

For visualizing the results of the `CmaMaeSampler`, note that we use the
`plot_grid_archive_heatmap` function from the `plot_pyribs` plugin.
Copy link
Contributor

Choose a reason for hiding this comment

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

I will quickly merge this PR, so you can surely open another PR later, but basically, the URL for each package is published like this, so you could link these URLs to your package!

package/visualization/plot_pyribs/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

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

I confirmed that the example works!
I will merge this PR:)

@nabenabe0928 nabenabe0928 merged commit 7a53f73 into optuna:main Dec 12, 2024
4 checks passed
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