Skip to content

Fix combination between PartialFixedSampler and TPESampler with group decomposed search space#6428

Merged
kAIto47802 merged 1 commit intooptuna:masterfrom
not522:fix-group
Feb 13, 2026
Merged

Fix combination between PartialFixedSampler and TPESampler with group decomposed search space#6428
kAIto47802 merged 1 commit intooptuna:masterfrom
not522:fix-group

Conversation

@not522
Copy link
Copy Markdown
Member

@not522 not522 commented Feb 9, 2026

Motivation

Fix #6427.
Since TPESampler contains a GroupDecomposedSearchSpace, it attempts to suggest parameters even for those that were excluded by the PartialFixedSampler.

Description of the changes

  • Fix the implementation of TPESampler to respect the search_space argument.
  • Add tests.

@not522 not522 added the bug Issue/PR about behavior that is broken. Not for typos/examples/CI/test but for Optuna itself. label Feb 9, 2026

x_sampled1 = study1.trials[0].params["x"]
y_sampled1 = study1.trials[0].params["y"]
assert x_sampled1 == x_sampled0
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think that this assertion can be removed because it depends on the implementation of RandomSampler.

@not522
Copy link
Copy Markdown
Member Author

not522 commented Feb 9, 2026

@y0z @kAIto47802 Could you review this PR?

@y0z y0z added this to the v4.8.0 milestone Feb 10, 2026
Copy link
Copy Markdown
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Collaborator

@kAIto47802 kAIto47802 left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. LGTM!

@kAIto47802 kAIto47802 merged commit 2ae7f7b into optuna:master Feb 13, 2026
14 checks passed
@not522 not522 deleted the fix-group branch February 13, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue/PR about behavior that is broken. Not for typos/examples/CI/test but for Optuna itself.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter suggestion with PartialFixedSampler and TPE fails mid-study

3 participants