...
|
...
|
@@ -220,8 +220,8 @@
|
220
|
220
|
"source": [
|
221
|
221
|
"import itertools\n",
|
222
|
222
|
"learner2 = adaptive.Learner2D(ring, bounds=learner.bounds)\n",
|
223
|
|
- "xs = np.linspace(*learner.bounds[0], learner.n**0.5)\n",
|
224
|
|
- "ys = np.linspace(*learner.bounds[1], learner.n**0.5)\n",
|
|
223
|
+ "n = int(learner.n**0.5)\n",
|
|
224
|
+ "xs, ys = [np.linspace(*bounds, n) for bounds in learner.bounds]\n",
|
225
|
225
|
"xys = list(itertools.product(xs, ys))\n",
|
226
|
226
|
"learner2.add_data(xys, map(partial(ring, wait=False), xys))\n",
|
227
|
227
|
"learner2.plot().relabel('Homogeneous grid') + learner.plot().relabel('With adaptive')"
|