Merge pull request #1086 from tberends/main

Additional explaination for the training loop
This commit is contained in:
Daniel Bourke authored and GitHub committed 2024-09-12 13:52:01 +10:00
commit b99a203289
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -880,7 +880,7 @@
">\n",
"> And on the ordering of things, the above is a good default order but you may see slightly different orders. Some rules of thumb: \n",
"> * Calculate the loss (`loss = ...`) *before* performing backpropagation on it (`loss.backward()`).\n",
"> * Zero gradients (`optimizer.zero_grad()`) *before* stepping them (`optimizer.step()`).\n",
"> * Zero gradients (`optimizer.zero_grad()`) *before* computing the gradients of the loss with respect to every model parameter (`loss.backward()`).\n",
"> * Step the optimizer (`optimizer.step()`) *after* performing backpropagation on the loss (`loss.backward()`).\n",
"\n",
"For resources to help understand what's happening behind the scenes with backpropagation and gradient descent, see the extra-curriculum section.\n"
+1 -1
View File
@@ -881,7 +881,7 @@
">\n",
"> And on the ordering of things, the above is a good default order but you may see slightly different orders. Some rules of thumb: \n",
"> * Calculate the loss (`loss = ...`) *before* performing backpropagation on it (`loss.backward()`).\n",
"> * Zero gradients (`optimizer.zero_grad()`) *before* stepping them (`optimizer.step()`).\n",
"> * Zero gradients (`optimizer.zero_grad()`) *before* computing the gradients of the loss with respect to every model parameter (`loss.backward()`).\n",
"> * Step the optimizer (`optimizer.step()`) *after* performing backpropagation on the loss (`loss.backward()`).\n",
"\n",
"For resources to help understand what's happening behind the scenes with backpropagation and gradient descent, see the extra-curriculum section.\n"