Skip to content

Commit 497c576

Browse files
committed
very small changes to the example notebook
1 parent bb9013c commit 497c576

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

learner.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@
747747
"\n",
748748
"# The `cdims` will automatically be set when using `from_product`, so\n",
749749
"# `plot()` will return a HoloMap with correctly labeled sliders.\n",
750-
"learner.plot().overlay('beta').grid()"
750+
"learner.plot().overlay('beta').grid().select(y=(-1, 3))"
751751
]
752752
},
753753
{
@@ -859,7 +859,7 @@
859859
"metadata": {},
860860
"outputs": [],
861861
"source": [
862-
"def g(x, noise_level=0.1):\n",
862+
"def F(x, noise_level=0.1):\n",
863863
" return (np.sin(5 * x) * (1 - np.tanh(x ** 2))\n",
864864
" + np.random.randn() * noise_level)"
865865
]
@@ -870,7 +870,7 @@
870870
"metadata": {},
871871
"outputs": [],
872872
"source": [
873-
"learner = adaptive.SKOptLearner(g, dimensions=[(-2., 2.)],\n",
873+
"learner = adaptive.SKOptLearner(F, dimensions=[(-2., 2.)],\n",
874874
" base_estimator=\"GP\",\n",
875875
" acq_func=\"gp_hedge\",\n",
876876
" acq_optimizer=\"lbfgs\",\n",
@@ -887,7 +887,7 @@
887887
"source": [
888888
"%%opts Overlay [legend_position='top']\n",
889889
"xs = np.linspace(*learner.space.bounds[0])\n",
890-
"to_learn = hv.Curve((xs, [g(x, 0) for x in xs]), label='to learn')\n",
890+
"to_learn = hv.Curve((xs, [F(x, 0) for x in xs]), label='to learn')\n",
891891
"\n",
892892
"runner.live_plot().relabel('prediction', depth=2) * to_learn"
893893
]

0 commit comments

Comments
 (0)