fix typo in comment

This commit is contained in:
rasbt
2024-06-09 06:14:02 -05:00
parent 39c4a887eb
commit 1b1fd21d64
7 changed files with 9 additions and 9 deletions

View File

@@ -1230,7 +1230,7 @@
" model.train() # Set model to training mode\n",
" \n",
" for input_batch, target_batch in train_loader:\n",
" optimizer.zero_grad() # Reset loss gradients from previous epoch\n",
" optimizer.zero_grad() # Reset loss gradients from previous batch iteration\n",
" loss = calc_loss_batch(input_batch, target_batch, model, device)\n",
" loss.backward() # Calculate loss gradients\n",
" optimizer.step() # Update model weights using loss gradients\n",
@@ -2477,7 +2477,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.10.6"
}
},
"nbformat": 4,