mirror of
https://github.com/mrdbourke/pytorch-deep-learning.git
synced 2026-11-27 06:07:09 +00:00
update headings
This commit is contained in:
1 parent
a0e08baf91
commit
476a5a0e98
1 file changed
+27
-6
@@ -840,7 +840,7 @@
|
||||
"id": "aFcKCsPcRfnA"
|
||||
},
|
||||
"source": [
|
||||
"### Creating a training loop in PyTorch\n",
|
||||
"### Creating an optimization loop in PyTorch\n",
|
||||
"\n",
|
||||
"Woohoo! Now we've got a loss function and an optimizer, it's now time to create a **training loop** (and **testing loop**).\n",
|
||||
"\n",
|
||||
@@ -855,9 +855,16 @@
|
||||
"\n",
|
||||
"*The unoffical PyTorch optimization loops song, a fun way to remember the steps in a PyTorch training (and testing) loop.*\n",
|
||||
"\n",
|
||||
"There will be a fair bit of code but nothing we can't handle.\n",
|
||||
"There will be a fair bit of code but nothing we can't handle.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"\n",
|
||||
"Specifically for the training loop, we'll follow the following steps:\n",
|
||||
"\n",
|
||||
"### PyTorch training loop\n",
|
||||
"For the training loop, we'll build the following steps:\n",
|
||||
"\n",
|
||||
"| Number | Step name | What does it do? | Code example |\n",
|
||||
"| ----- | ----- | ----- | ----- |\n",
|
||||
@@ -871,9 +878,19 @@
|
||||
">\n",
|
||||
"> And on the ordering of things, the above is a good default order but you may see slightly different orders, the only rule of thumb is to zero gradients (`optimizer.zero_grad`) *before* stepping them (`optimizer.step()`) and calculate the loss (`loss = ...`) *before* performing backpropagation on it (`loss.backward()`). Though there are exceptions to these, they are beyond the scope of the course.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "agXn72H-sgyd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"\n",
|
||||
"And a typical testing loop may contain the following steps:\n",
|
||||
"### PyTorch testing loop\n",
|
||||
"\n",
|
||||
"As for the testing loop (evaluating our model), the typical steps include:\n",
|
||||
"\n",
|
||||
"| Number | Step name | What does it do? | Code example |\n",
|
||||
"| ----- | ----- | ----- | ----- |\n",
|
||||
@@ -886,7 +903,10 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"Let's put all of the above together and train our model for 100 **epochs** (forward passes through the data) and we'll evaluate it every 10 epochs.\n"
|
||||
]
|
||||
],
|
||||
"metadata": {
|
||||
"id": "OXHDdlfjssDc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
@@ -2424,6 +2444,7 @@
|
||||
"collapsed_sections": [],
|
||||
"name": "01_pytorch_workflow.ipynb",
|
||||
"provenance": [],
|
||||
"toc_visible": true,
|
||||
"include_colab_link": true
|
||||
},
|
||||
"interpreter": {
|
||||
|
||||
Reference in new issue
Block a user