Skip to content

Commit

Permalink
Update custom_botorch_model_in_ax.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
saitcakmak authored Feb 5, 2025
1 parent ad88ece commit aa2bb65
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,10 @@
"showInput": false
},
"source": [
"### Instantiate a `BoTorchModel` in Ax\n",
"### Instantiate a `BoTorchGenerator` in Ax\n",
"\n",
"A `BoTorchModel` in Ax encapsulates both the surrogate -- which `Ax` calls a `Surrogate` and BoTorch calls a `Model` -- and an acquisition function. Here, we will only specify the custom surrogate and let Ax choose the default acquisition function.\n",
"A `BoTorchGenerator` in Ax encapsulates both the surrogate -- which `Ax` calls a `Surrogate` and BoTorch calls a `Model` -- and an acquisition function. Here, we will only specify the custom surrogate and let Ax choose the default acquisition function.\n",
"\n",
"Most models should work with the base `Surrogate` in Ax, except for BoTorch `ModelListGP`, which works with `ListSurrogate`.\n",
"Note that the `Model` (e.g., the `SimpleCustomGP`) must implement `construct_inputs`, as this is used to construct the inputs required for instantiating a `Model` instance from the experiment data."
]
},
Expand All @@ -188,11 +187,11 @@
},
"outputs": [],
"source": [
"from ax.models.torch.botorch_modular.model import BoTorchModel\n",
"from ax.models.torch.botorch_modular.model import BoTorchGenerator\n",
"from ax.models.torch.botorch_modular.surrogate import Surrogate, SurrogateSpec\n",
"from ax.models.torch.botorch_modular.utils import ModelConfig\n",
"\n",
"ax_model = BoTorchModel(\n",
"ax_model = BoTorchGenerator(\n",
" surrogate=Surrogate(\n",
" surrogate_spec=SurrogateSpec(\n",
" model_configs=[\n",
Expand Down Expand Up @@ -230,7 +229,7 @@
"source": [
"### Combine with a `ModelBridge`\n",
"\n",
"`Model`s in Ax require a `ModelBridge` to interface with `Experiment`s. A `ModelBridge` takes the inputs supplied by the `Experiment` and converts them to the inputs expected by the `Model`. For a `BoTorchModel`, we use `TorchModelBridge`. The Modular BoTorch interface creates the `BoTorchModel` and the `TorchModelBridge` in a single step, as follows:\n",
"`Model`s in Ax require a `ModelBridge` to interface with `Experiment`s. A `ModelBridge` takes the inputs supplied by the `Experiment` and converts them to the inputs expected by the `Model`. For a `BoTorchGenerator`, we use `TorchModelBridge`. The Modular BoTorch interface creates the `BoTorchGenerator` and the `TorchModelBridge` in a single step, as follows:\n",
"\n",
"```\n",
"from ax.modelbridge.registry import Generators\n",
Expand Down

0 comments on commit aa2bb65

Please sign in to comment.