python_code
stringlengths
0
229k
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import argparse import re def patch_config( config_file: str, base_url: str...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import argparse import os import pkgutil import re from typing import Set # Pat...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import torch LOG_LEVEL_DEFAULT = logging.CRITICAL def _get_logger( name: str = "botorch", leve...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Model fitting routines.""" from __future__ import annotations import logging from contextlib import nullcontext...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import gpytorch.settings as gp_settings import linear_operator.settings as linop_settings from botorch import ( a...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" BoTorch settings. """ from __future__ import annotations from botorch.logging import LOG_LEVEL_DEFAULT, logger...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Cross-validation utilities using batch evaluation mode. """ from __future__ import annotations from typing imp...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Synthetic functions for optimization benchmarks. Most test functions (if not indicated otherwise) are taken fro...
#! /usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Multi-objective optimization benchmark problems. References .. [Daulton2022] S. Daulton, S. Cakmak, M. Ba...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Multi-objective multi-fidelity optimization benchmark problems. References .. [Irshad2021] F. Irshad, S. K...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.test_functions.multi_fidelity import ( AugmentedBranin, AugmentedHartmann, AugmentedRosenbro...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math from typing import List, Optional, Tuple import torch from botorch.test_functions.synthetic import SyntheticTestFunction from ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from typing import Optional, Tuple import torch from torch import Tensor def...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Base class for test functions for optimization benchmarks. """ from __future__ import annotations from abc imp...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Synthetic functions for multi-fidelity optimization benchmarks. """ from __future__ import annotations import ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Preference acquisition functions. This includes: Analytical EUBO acquisition function as introduced in [Lin2022p...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Modules to add regularization to acquisition functions. """ from __future__ import annotations import math fro...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Objective Modules to be used with acquisition functions.""" from __future__ import annotations import inspect i...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Abstract class for acquisition functions leveraging a cached Cholesky decomposition of the posterior covaiance o...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" A wrapper around AcquisitionFunctions to add proximal weighting of the acquisition function. """ from __future_...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Active learning acquisition functions. .. [Seo2014activedata] S. Seo, M. Wallat, T. Graepel, and K. Obermay...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Risk Measures implemented as Monte-Carlo objectives, based on Bayesian optimization of risk measures as introduc...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.acquisition.acquisition import ( AcquisitionFunction, OneShotAcquisitionFunction, ) from botorch...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Batch Knowledge Gradient (KG) via one-shot optimization as introduced in [Balandat2020botorch]_. For broader dis...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Batch acquisition functions using the reparameterization trick in combination with (quasi) Monte-Carlo sampling....
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Utilities for acquisition functions. """ from __future__ import annotations from typing import Callable, List,...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Acquisition function for joint entropy search (JES). .. [Hvarfner2022joint] C. Hvarfner, F. Hutter, L. Nard...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" A registry of helpers for generating inputs to acquisition function constructors programmatically from a consist...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" A general implementation of multi-step look-ahead acquistion function with configurable value functions. See [Ji...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" A wrapper around AquisitionFunctions to fix certain features for optimization. This is useful e.g. for performin...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Cost functions for cost-aware acquisition functions, e.g. multi-fidelity KG. To be used in a context where there...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Utilities for acquisition functions. """ from __future__ import annotations import math from typing import Cal...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Acquisition function for predictive entropy search (PES). The code utilizes the implementation designed for the ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Acquisition functions for Max-value Entropy Search (MES), General Information-Based Bayesian Optimization (GIBBO...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Abstract base module for all botorch acquisition functions.""" from __future__ import annotations import warnin...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Batch implementations of the LogEI family of improvements-based acquisition functions. """ from __future__ import annotations from co...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Analytic Acquisition Functions that evaluate the posterior without performing Monte-Carlo sampling. """ from __...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Prior-Guided Acquisition Functions References .. [Hvarfner2022] C. Hvarfner, D. Stoll, A. Souza, M. Lindau...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Abstract base module for decoupled acquisition functions.""" from __future__ import annotations import warnings...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import warnings from abc import abstractmethod from typing import List, Optional...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.acquisition.multi_objective.analytic import ( ExpectedHypervolumeImprovement, MultiObjectiveAnal...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Monte-Carlo Acquisition Functions for Multi-objective Bayesian optimization. References .. [Daulton2020qehvi] ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Acquisition functions for joint entropy search for Bayesian optimization (JES). References: .. [Tu2022] B....
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Utilities for multi-objective acquisition functions. """ from __future__ import annotations import math import...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Acquisition function for predictive entropy search for multi-objective Bayesian optimization (PES). The code doe...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Multi-output extensions of the risk measures, implemented as Monte-Carlo objectives. Except for MVaR, the risk m...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Acquisition functions for max-value entropy search for multi-objective Bayesian optimization (MESMO). Reference...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Analytic Acquisition Functions for Multi-objective Bayesian optimization. References .. [Yang2019] Yang, K...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Multi-Fidelity Acquisition Functions for Multi-objective Bayesian optimization. References .. [Irshad2021MOMF]...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Samplers to enable use cases that are not base sample driven, such as stochastic optimization of acquisition fun...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" A dummy sampler for use with deterministic models. """ from __future__ import annotations from botorch.posteri...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Sampler modules producing N(0,1) samples, to be used with MC-evaluated acquisition functions and Gaussian poster...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.sampling.base import MCSampler from botorch.sampling.deterministic import DeterministicSampler from boto...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from itertools import combinations from typing import Any, Optional import numpy...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Type, Union import torch from botorch.logging import logger from botorch.posteriors.determi...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Sampler to be used with `EnsemblePosteriors` to enable deterministic optimization of acquisition functions with ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Quasi Monte-Carlo sampling from Normal distributions. References: .. [Pages2018numprob] G. Pages. Numerica...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" The base class for sampler modules to be used with MC-evaluated acquisition functions. """ from __future__ impo...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" A `SamplerList` for sampling from a `PosteriorList`. """ from __future__ import annotations import torch from ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from typing import Any, Callable, List, Optional from botorch.models.approximate...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from abc import ABC from typing import ( Any, Callable, Dict, Ite...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" .. [wilson2020sampling] J. Wilson, V. Borovitskiy, A. Terenin, P. Mostowsky, and M. Deisenroth. Efficiently ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.sampling.pathwise.features import ( gen_kernel_features, KernelEvaluationMap, KernelFeature...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from typing import Any, Callable, Optional, Union import torch from botorch.mode...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from abc import ABC, abstractmethod from typing import Any, Callable, Iterable, L...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from typing import Optional, Union import torch from botorch.sampling.pathwise.u...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.sampling.pathwise.features.generators import gen_kernel_features from botorch.sampling.pathwise.feature...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" .. [rahimi2007random] A. Rahimi and B. Recht. Random features for large-scale kernel machines. Advances ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Methods for optimizing acquisition functions. """ from __future__ import annotations import dataclasses impor...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Tools for model fitting.""" from __future__ import annotations from functools import partial from itertools imp...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import math from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Any...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.optim.closures import ( ForwardBackwardClosure, get_loss_closure, get_loss_closure_with_grad...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Core abstractions and generic optimizers.""" from __future__ import annotations import re from dataclasses impo...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" A converter that simplifies using numpy-based optimizers with generic torch `nn.Module` classes. This enables us...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from abc import ABC, abstractmethod import torch from torch import Tensor clas...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" References .. [Regis] R. G. Regis, C. A. Shoemaker. Combining radial basis function surrogates and dyna...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Callable, Dict, Optional, Tuple, Union import torch from botorch.acquisition import AcquisitionFunction from botorch.opt...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Utility functions for constrained optimization. """ from __future__ import annotations from functools import p...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Utilities for fitting and manipulating models.""" from __future__ import annotations from re import Pattern fro...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Utilities for interfacing Numpy and Torch.""" from __future__ import annotations from itertools import tee from...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import time from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Un...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.optim.utils.acquisition_utils import ( columnwise_clamp, fix_features, get_X_baseline, ) fro...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Utilities for maximizing acquisition functions.""" from __future__ import annotations from typing import Dict, ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""General-purpose optimization utilities.""" from __future__ import annotations from inspect import signature fro...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.optim.closures.core import ( ForwardBackwardClosure, NdarrayOptimizationClosure, ) from botorch....
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Core methods for building closures in torch and interfacing with numpy.""" from __future__ import annotations fr...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Utilities for building model-based closures.""" from __future__ import annotations from itertools import chain,...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from inspect import getsource, getsourcefile from typing import Any, Callable, Op...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Some basic data transformation helpers. """ from __future__ import annotations import warnings from functools ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import torch from botorch.exceptions.errors import BotorchError from botorch.post...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Helpers for handling objectives. """ from __future__ import annotations import warnings from typing import Ca...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Representations for different kinds of data.""" from __future__ import annotations from abc import ABC, abstrac...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from functools import lru_cache from numbers import Number from typing import Ite...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Discretization (rounding) functions for acquisition optimization. References .. [Daulton2022bopr] S. Dault...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r"""Representations for different kinds of datasets.""" from __future__ import annotations import warnings from ite...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from botorch.utils.constraints import get_outcome_constraint_transforms from botorch.utils.feasible_volume import est...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations NoneType = type(None) # stop gap for the return of NoneType in 3.10 class _De...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Utilities for optimization. """ from __future__ import annotations from contextlib import contextmanager from ...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Utilities for MC and qMC sampling. References .. [Trikalinos2014polytope] T. A. Trikalinos and G. van Valk...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. r""" Helpers for handling input or outcome constraints. """ from __future__ import annotations from functools impor...