Skip to content

Add preferential optimization picture#327

Merged
nzw0301 merged 10 commits intooptuna:mainfrom
milkcoffeen:add-preferential-optimization-picture
Jun 6, 2025
Merged

Add preferential optimization picture#327
nzw0301 merged 10 commits intooptuna:mainfrom
milkcoffeen:add-preferential-optimization-picture

Conversation

@milkcoffeen
Copy link
Copy Markdown
Contributor

@milkcoffeen milkcoffeen commented May 31, 2025

Motivation

This pull request introduces a new example for generating and optimizing images using preferential optimization with Optuna. It includes documentation, a generator script, and a shell script to launch the dashboard. Below are the key changes grouped by theme:

Description of the changes

add preferential optimization Image
add README

Copy link
Copy Markdown
Collaborator

@Alnusjaponica Alnusjaponica left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. I made some minor comments. PTAL.


# 2. Generate image
image_path = os.path.join(tmpdir, f"sample-{trial.number}.png")
image = Image.open("sample.png")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would be better to pass down image path from cli option.

Suggested change
image = Image.open("sample.png")
image = Image.open("sample.png")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Plus, it suffice to open the original image only once, before the loop starts.

@toshihikoyanase toshihikoyanase added feature Change that does not break compatibility, but affects the public interfaces of examples. sprint-20250531 PR from the online sprint event May 31, 2025. labels May 31, 2025
@milkcoffeen milkcoffeen force-pushed the add-preferential-optimization-picture branch from 5ba754c to 70480ec Compare May 31, 2025 07:47
Copy link
Copy Markdown
Collaborator

@Alnusjaponica Alnusjaponica left a comment

Choose a reason for hiding this comment

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

Could you fix the database path?

Then, launch Optuna Dashboard in a separate process using the following command.

```bash
optuna-dashboard sqlite:///example.db --artifact-dir ./artifact
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please use the same DB path. ref: optuna/optuna-dashboard#469

Suggested change
optuna-dashboard sqlite:///example.db --artifact-dir ./artifact
optuna-dashboard sqlite:///db.sqlite3 --artifact-dir ./artifact

@milkcoffeen
Copy link
Copy Markdown
Contributor Author

These changes have been reflected.

Copy link
Copy Markdown
Collaborator

@Alnusjaponica Alnusjaponica left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.
@nzw0301 Could you take another look?

Copy link
Copy Markdown
Member

@nzw0301 nzw0301 left a comment

Choose a reason for hiding this comment

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

Sorry for my late responses. I've left a few more comments. In addition, can you explain where sample.png comes from?

@milkcoffeen
Copy link
Copy Markdown
Contributor Author

Thank you for the review. I've made the changes.
sample.png was provided by @Alnusjaponica .

Copy link
Copy Markdown
Member

@nzw0301 nzw0301 left a comment

Choose a reason for hiding this comment

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

Lovely. Thank you for your response. I was a bit worried about the licence of the picture, but it sounds fine since it's provided.

@nzw0301 nzw0301 merged commit ea3271e into optuna:main Jun 6, 2025
6 checks passed
@nzw0301 nzw0301 added this to the v4.4.0 milestone Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Change that does not break compatibility, but affects the public interfaces of examples. sprint-20250531 PR from the online sprint event May 31, 2025.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants