Use cached trials in TPESampler's sample_relative#6265
Merged
nabenabe0928 merged 3 commits intooptuna:masterfrom Sep 5, 2025
Merged
Use cached trials in TPESampler's sample_relative#6265nabenabe0928 merged 3 commits intooptuna:masterfrom
TPESampler's sample_relative#6265nabenabe0928 merged 3 commits intooptuna:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6265 +/- ##
==========================================
- Coverage 89.24% 89.16% -0.08%
==========================================
Files 208 208
Lines 13821 13833 +12
==========================================
Hits 12334 12334
- Misses 1487 1499 +12 ☔ View full report in Codecov by Sentry. |
Contributor
|
@sawa3030 |
nabenabe0928
reviewed
Sep 2, 2025
nabenabe0928
reviewed
Sep 2, 2025
nabenabe0928
reviewed
Sep 2, 2025
nabenabe0928
reviewed
Sep 2, 2025
nabenabe0928
reviewed
Sep 2, 2025
Contributor
nabenabe0928
left a comment
There was a problem hiding this comment.
Thank you for the PR, mostly LGTM!
I left some minor comments:)
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, whether
TPESamplerusesuse_cacheinstudy._get_trialsdepends solely on whether it usesconstant liar. However, sincesample_relativeis called only once at the beginning of aTrial, it can utilizeuse_cache.Description of the changes
Making
TPESampler'ssample_relativemethod always use cached trials.Benchmark