Skip to content

Commit

Permalink
minor fixes to notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybdub committed Jan 16, 2020
1 parent 9a4bfab commit cc1112a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
9 changes: 7 additions & 2 deletions notebooks/collision_avoidance/live_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@
},
"outputs": [],
"source": [
"import time\n",
"\n",
"camera.unobserve(update, names='value')\n",
"\n",
"time.sleep(0.1) # add a small sleep to make sure frames have finished processing\n",
"\n",
"robot.stop()"
]
},
Expand Down Expand Up @@ -302,9 +307,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
9 changes: 7 additions & 2 deletions notebooks/road_following/live_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@
"metadata": {},
"outputs": [],
"source": [
"import time\n",
"\n",
"camera.unobserve(execute, names='value')\n",
"\n",
"time.sleep(0.1) # add a small sleep to make sure frames have finished processing\n",
"\n",
"robot.stop()"
]
},
Expand Down Expand Up @@ -348,9 +353,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
8 changes: 4 additions & 4 deletions notebooks/road_following/train_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
" optimizer.zero_grad()\n",
" outputs = model(images)\n",
" loss = F.mse_loss(outputs, labels)\n",
" train_loss += loss\n",
" train_loss += float(loss)\n",
" loss.backward()\n",
" optimizer.step()\n",
" train_loss /= len(train_loader)\n",
Expand All @@ -258,7 +258,7 @@
" labels = labels.to(device)\n",
" outputs = model(images)\n",
" loss = F.mse_loss(outputs, labels)\n",
" test_loss += loss\n",
" test_loss += float(loss)\n",
" test_loss /= len(test_loader)\n",
" \n",
" print('%f, %f' % (train_loss, test_loss))\n",
Expand Down Expand Up @@ -293,9 +293,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit cc1112a

Please sign in to comment.