Skip to content

Commit 64d0c67

Browse files
esantorellafacebook-github-bot
authored andcommitted
Add non-abstract poll_exception method to MyRunner in custom botorch model tutorial (#2087)
Summary: ## Motivation [Ax https://github.com/pytorch/botorch/issues/1958](https://github.com/facebook/Ax/pull/1958) broke the custom botorch model tutorial by adding an abstract method to the `Runner` class; the tutorial contained a `Runner` subclass that did not override this method. I fixed this by adding a method that returns a `NotImplementedError`. Pull Request resolved: #2087 Test Plan: Ran tutorial locally: `python scripts/run_tutorials.py -p "$(pwd)" -s -n custom_botorch_model_in_ax.ipynb` Reviewed By: saitcakmak Differential Revision: D51046160 Pulled By: esantorella fbshipit-source-id: dd3b86f379f44be51fda01cbc412559a1e84b475
1 parent 7d90433 commit 64d0c67

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tutorials/custom_botorch_model_in_ax.ipynb

+9-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
"from typing import Optional\n",
9292
"\n",
9393
"from botorch.models.gpytorch import GPyTorchModel\n",
94-
"from botorch.utils.datasets import SupervisedDataset\n",
9594
"from gpytorch.distributions import MultivariateNormal\n",
9695
"from gpytorch.kernels import RBFKernel, ScaleKernel\n",
9796
"from gpytorch.likelihoods import GaussianLikelihood\n",
@@ -1140,6 +1139,15 @@
11401139
" trial_metadata = {\"name\": str(trial.index)}\n",
11411140
" return trial_metadata\n",
11421141
"\n",
1142+
" def poll_exception(self, trial) -> str:\n",
1143+
" \"\"\"\n",
1144+
" Returns the exception from a trial if present. In this case, we do not\n",
1145+
" expect that trials will have attached exceptions.\n",
1146+
" \"\"\"\n",
1147+
" raise NotImplementedError(\n",
1148+
" f\"{self.__class__.__name__} does not implement a `poll_exception` method.\"\n",
1149+
" )\n",
1150+
"\n",
11431151
"\n",
11441152
"exp = Experiment(\n",
11451153
" name=\"branin_experiment\",\n",

0 commit comments

Comments
 (0)