-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Simon Sung <[email protected]>
- Loading branch information
1 parent
cb12051
commit 094b320
Showing
17 changed files
with
217 additions
and
86 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from pydantic import validator | ||
|
||
from bofire.data_models.surrogates.botorch import BotorchSurrogate | ||
from bofire.data_models.surrogates.scaler import ScalerEnum | ||
from bofire.data_models.surrogates.trainable import TrainableSurrogate | ||
|
||
|
||
class TrainableBotorchSurrogate(BotorchSurrogate, TrainableSurrogate): | ||
scaler: ScalerEnum = ScalerEnum.NORMALIZE | ||
output_scaler: ScalerEnum = ScalerEnum.STANDARDIZE | ||
|
||
@validator("output_scaler") | ||
def validate_output_scaler(cls, output_scaler): | ||
"""validates that output_scaler is a valid type | ||
Args: | ||
output_scaler (ScalerEnum): Scaler used to transform the output | ||
Raises: | ||
ValueError: when ScalerEnum.NORMALIZE is used | ||
Returns: | ||
ScalerEnum: Scaler used to transform the output | ||
""" | ||
if output_scaler == ScalerEnum.NORMALIZE: | ||
raise ValueError("Normalize is not supported as an output transform.") | ||
|
||
return output_scaler |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.