diff --git a/docs/examples/adaptive_motor_control.ipynb b/docs/examples/adaptive_motor_control.ipynb index 4bea309f9..38b84d164 100644 --- a/docs/examples/adaptive_motor_control.ipynb +++ b/docs/examples/adaptive_motor_control.ipynb @@ -427,9 +427,9 @@ "source": [ "## Running the network with Nengo Loihi\n", "\n", - "Loihi has some implicit gains included in it\n", - "so we use a learning rate of 1e-6 in Nengo Loihi,\n", - "instead of 1e-5, to match the performance of the standard Nengo backend." + "Loihi has limits on the magnitude of the \n", + "error signal, so we need to adjust the\n", + "`pes_error_scale` parameter to avoid too much overflow." ] }, { @@ -438,10 +438,12 @@ "metadata": {}, "outputs": [], "source": [ - "adapt_loihi_model = add_adaptation(\n", - " add_gravity(build_baseline_model()), learning_rate=1e-6)\n", "arm_sim.reset()\n", - "with nengo_loihi.Simulator(adapt_loihi_model) as sim:\n", + "\n", + "model = nengo_loihi.builder.Model()\n", + "model.pes_error_scale = 10\n", + "\n", + "with nengo_loihi.Simulator(adapt_model, model=model) as sim:\n", " sim.run(runtime)\n", "adapt_loihi_t = sim.trange()\n", "adapt_loihi_data = sim.data" @@ -453,10 +455,10 @@ "metadata": {}, "outputs": [], "source": [ - "adapt_loihi_error = calculate_error(adapt_loihi_model, adapt_loihi_data)\n", + "adapt_loihi_error = calculate_error(adapt_model, adapt_loihi_data)\n", "plot_xy(\n", " [adapt_loihi_t],\n", - " [adapt_loihi_data[adapt_loihi_model.probe_hand]],\n", + " [adapt_loihi_data[adapt_model.probe_hand]],\n", " ['Adapt'])\n", "plot_data(\n", " [baseline_t, gravity_t, adapt_t, adapt_loihi_t],\n",