Skip to content

Conversation

@Scienfitz
Copy link
Collaborator

Implements #658

@Scienfitz Scienfitz self-assigned this Oct 14, 2025
Copilot AI review requested due to automatic review settings October 14, 2025 14:51
@Scienfitz Scienfitz added the enhancement Expand / change existing functionality label Oct 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the handling of surrogate model limitations when working with continuous parameters by replacing a blanket restriction with proper error handling and user feedback. The changes address issue #658 by allowing surrogate models to attempt gradient computation and gracefully failing with informative error messages when they cannot support continuous spaces.

Key changes:

  • Replaces upfront surrogate compatibility checks with runtime error handling
  • Adds comprehensive test coverage for surrogate-continuous parameter incompatibilities
  • Updates documentation to reflect the improved error handling approach

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_surrogate.py Adds parametrized test to verify proper error handling for incompatible surrogate-continuous parameter combinations
docs/userguide/constraints.md Removes outdated warning about silent constraint ignoring
baybe/surrogates/base.py Removes blanket restriction preventing non-GP surrogates from being used with continuous spaces
baybe/recommenders/pure/bayesian/base.py Adds try-catch logic to detect gradient computation failures and raise informative error messages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Scienfitz Scienfitz force-pushed the improve/continuous_surrogate_limitations branch from 39d9906 to f098802 Compare October 14, 2025 15:10
Copy link
Collaborator

@AVHopp AVHopp left a comment

Choose a reason for hiding this comment

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

LGTM

@AdrianSosic AdrianSosic linked an issue Oct 27, 2025 that may be closed by this pull request
2 tasks
@Scienfitz Scienfitz force-pushed the improve/continuous_surrogate_limitations branch 2 times, most recently from e7ae91e to 29e2cc1 Compare November 3, 2025 09:57
@Scienfitz Scienfitz force-pushed the improve/continuous_surrogate_limitations branch from 29e2cc1 to 227a26d Compare November 10, 2025 13:19
@Scienfitz Scienfitz merged commit 641169c into main Nov 12, 2025
11 of 12 checks passed
@Scienfitz Scienfitz deleted the improve/continuous_surrogate_limitations branch November 12, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Expand / change existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Continuous Constraints / Optimization Interaction with Surrogates

4 participants