https://github.com/amir22010/botorch
Bayesian optimization in PyTorch
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (20.4%) to scientific vocabulary
Last synced: 9 months ago
·
JSON representation
Repository
Bayesian optimization in PyTorch
Basic Info
- Host: GitHub
- Owner: Amir22010
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://botorch.org
- Size: 9.65 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Fork of pytorch/botorch
Created almost 7 years ago
· Last pushed almost 7 years ago
https://github.com/Amir22010/botorch/blob/master/
![]()
[](https://anaconda.org/pytorch/botorch) [](https://pypi.org/project/botorch) [](LICENSE) [](https://circleci.com/gh/pytorch/botorch) [](https://codecov.io/github/pytorch/botorch) BoTorch is a library for Bayesian Optimization built on PyTorch. *BoTorch is currently in beta and under active development!* #### Why BoTorch ? BoTorch * Provides a modular and easily extensible interface for composing Bayesian optimization primitives, including probabilistic models, acquisition functions, and optimizers. * Harnesses the power of PyTorch, including auto-differentiation, native support for highly parallelized modern hardware (e.g. GPUs) using device-agnostic code, and a dynamic computation graph. * Supports Monte Carlo-based acquisition functions via the [reparameterization trick](https://arxiv.org/abs/1312.6114), which makes it straightforward to implement new ideas without having to impose restrictive assumptions about the underlying model. * Enables seamless integration with deep and/or convolutional architectures in PyTorch. * Has first-class support for state-of-the art probabilistic models in [GPyTorch](http://www.gpytorch.ai/), including support for multi-task Gaussian Processes (GPs) deep kernel learning, deep GPs, and approximate inference. #### Target Audience The primary audience for hands-on use of BoTorch are researchers and sophisticated practitioners in Bayesian Optimization and AI. We recommend using BoTorch as a low-level API for implementing new algorithms for [Ax](https://ax.dev). Ax has been designed to be an easy-to-use platform for end-users, which at the same time is flexible enough for Bayesian Optimization researchers to plug into for handling of feature transformations, (meta-)data management, storage, etc. We recommend that end-users who are not actively doing research on Bayesian Optimization simply use Ax. ## Installation **Installation Requirements** - Python >= 3.6 - PyTorch >= 1.1 - gpytorch >= 0.3.3 - scipy ##### Installing the latest release The latest release of BoTorch is easily installed either via [Anaconda](https://www.anaconda.com/distribution/#download-section) (recommended): ```bash conda install botorch -c pytorch ``` or via `pip`: ```bash pip install botorch ``` ***Important note for MacOS users:*** * You will want to make sure your PyTorch build is linked against MKL (the non-optimized version of BoTorch can be up to an order of magnitude slower in some settings). Setting this up manually on MacOS can be tricky - to ensure this works properly please follow the [PyTorch installation instructions](https://pytorch.org/get-started/locally/). * If you need CUDA on MacOS, you will need to build PyTorch from source. Please consult the PyTorch installation instructions above. ##### Installing from latest master If you'd like to try our bleeding edge features (and don't mind potentially running into the occasional bug here or there), you can install the latest master directly from GitHub (this will also require installing the current GPyTorch master): ```bash pip install git+https://github.com/cornellius-gp/gpytorch.git pip install git+https://github.com/pytorch/botorch.git ``` **Manual / Dev install** Alternatively, you can do a manual install. For a basic install, run: ```bash git clone https://github.com/pytorch/botorch.git cd botorch pip install -e . ``` To customize the installation, you can also run the following variants of the above: * `pip install -e .[dev]`: Also installs all tools necessary for development (testing, linting, docs building; see [Contributing](#contributing) below). * `pip install -e .[tutorials]`: Also installs all packages necessary for running the tutorial notebooks. ## Getting Started Here's a quick run down of the main components of a Bayesian optimization loop. For more details see our [Documentation](https://botorch.org/docs/introduction) and the [Tutorials](https://botorch.org/tutorials). 1. Fit a Gaussian Process model to data ```python import torch from botorch.models import SingleTaskGP from botorch.fit import fit_gpytorch_model from gpytorch.mlls import ExactMarginalLogLikelihood train_X = torch.rand(10, 2) Y = 1 - torch.norm(train_X - 0.5, dim=-1) + 0.1 * torch.rand(10) train_Y = (Y - Y.mean()) / Y.std() gp = SingleTaskGP(train_X, train_Y) mll = ExactMarginalLogLikelihood(gp.likelihood, gp) fit_gpytorch_model(mll) ``` 2. Construct an acquisition function ```python from botorch.acquisition import UpperConfidenceBound UCB = UpperConfidenceBound(gp, beta=0.1) ``` 3. Optimize the acquisition function ```python from botorch.optim import joint_optimize bounds = torch.stack([torch.zeros(2), torch.ones(2)]) candidate = joint_optimize( UCB, bounds=bounds, q=1, num_restarts=5, raw_samples=20, ) ``` ## Contributing See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out. ## License BoTorch is MIT licensed, as found in the [LICENSE](LICENSE) file.
Owner
- Name: Amir Khan
- Login: Amir22010
- Kind: user
- Location: India
- Repositories: 3
- Profile: https://github.com/Amir22010
working on developing a state of art AI solutions mainly in computer vision, chat bots and nlp domain. building an awesome AI as a professional developer 😍.