|
747 | 747 | "\n", |
748 | 748 | "# The `cdims` will automatically be set when using `from_product`, so\n", |
749 | 749 | "# `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))" |
751 | 751 | ] |
752 | 752 | }, |
753 | 753 | { |
|
859 | 859 | "metadata": {}, |
860 | 860 | "outputs": [], |
861 | 861 | "source": [ |
862 | | - "def g(x, noise_level=0.1):\n", |
| 862 | + "def F(x, noise_level=0.1):\n", |
863 | 863 | " return (np.sin(5 * x) * (1 - np.tanh(x ** 2))\n", |
864 | 864 | " + np.random.randn() * noise_level)" |
865 | 865 | ] |
|
870 | 870 | "metadata": {}, |
871 | 871 | "outputs": [], |
872 | 872 | "source": [ |
873 | | - "learner = adaptive.SKOptLearner(g, dimensions=[(-2., 2.)],\n", |
| 873 | + "learner = adaptive.SKOptLearner(F, dimensions=[(-2., 2.)],\n", |
874 | 874 | " base_estimator=\"GP\",\n", |
875 | 875 | " acq_func=\"gp_hedge\",\n", |
876 | 876 | " acq_optimizer=\"lbfgs\",\n", |
|
887 | 887 | "source": [ |
888 | 888 | "%%opts Overlay [legend_position='top']\n", |
889 | 889 | "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", |
891 | 891 | "\n", |
892 | 892 | "runner.live_plot().relabel('prediction', depth=2) * to_learn" |
893 | 893 | ] |
|
0 commit comments