{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Basics of Trust Region Controllers in Xopt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Trust Region Bayesian Optimization (TuRBO) is an advanced optimization algorithm designed for solving high-dimensional black-box optimization problems. It combines the strengths of Bayesian Optimization (BO) with trust region methods to improve scalability and efficiency.\n", "\n", "### Key Features:\n", "1. **Trust Regions**:\n", " - TuRBO uses local trust regions to focus the search in promising areas of the parameter space.\n", " - Each trust region is a bounded subspace where the optimization is performed, and its size is dynamically adjusted based on the success of the optimization.\n", "\n", "2. **Bayesian Surrogate Model**:\n", " - A Gaussian Process (GP) or other surrogate models are used to approximate the objective function.\n", " - This surrogate model is used to predict the objective function and guide the search as well as define the size of the trust region.\n", "\n", "4. **Adaptivity**:\n", " - The algorithm adapts the size of the trust region based on the success or failure of the optimization steps. If the optimization within a trust region is successful, the region expands; otherwise, it shrinks.\n", "\n", "### Advantages:\n", "- Scales better to high-dimensional problems compared to standard Bayesian Optimization.\n", "- Efficiently balances exploration and exploitation within trust regions.\n", "\n", "### Disadvantages:\n", "- Severely restricts exploration of the parameter space potentially leading to convergence to local minima, thus making it sensitive to initial sampling points.\n", "- Introduces additional algorithm hyperparameters which can cause issues. \n", "- May struggle with noisy objective functions or discontinuous landscapes. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Defining a TuRBO Controller\n", "Currently, Xopt supports 3 different TuRBO controller types, the most basic of which is the `OptimizeTurboController`. To create this controller we need to define our optimization problem and some data." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2025-05-30T15:50:25.743819Z", "iopub.status.busy": "2025-05-30T15:50:25.743657Z", "iopub.status.idle": "2025-05-30T15:50:27.140101Z", "shell.execute_reply": "2025-05-30T15:50:27.139587Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | f | \n", "x | \n", "y | \n", "
---|---|---|---|
0 | \n", "20.847724 | \n", "-4.320888 | \n", "-1.475685 | \n", "
1 | \n", "23.581958 | \n", "4.824495 | \n", "0.553360 | \n", "
2 | \n", "9.462963 | \n", "-2.429524 | \n", "1.886896 | \n", "
3 | \n", "11.345391 | \n", "3.265719 | \n", "-0.824906 | \n", "
4 | \n", "20.360560 | \n", "-1.907623 | \n", "-4.089197 | \n", "
5 | \n", "8.131317 | \n", "0.092806 | \n", "2.850036 | \n", "
6 | \n", "12.911151 | \n", "3.548850 | \n", "0.562862 | \n", "
7 | \n", "3.640478 | \n", "1.223779 | \n", "1.463845 | \n", "
8 | \n", "25.058311 | \n", "2.427704 | \n", "4.377735 | \n", "
9 | \n", "21.220171 | \n", "3.125956 | \n", "-3.383574 | \n", "