mrdbourke / pytorch-deep-learning

Materials for the Learn PyTorch for Deep Learning: Zero to Mastery course.
https://learnpytorch.io
MIT License
9.34k stars 2.78k forks source link

03_pytorch_computer_vision clarification on a comment #886

Open samiulhq opened 3 months ago

samiulhq commented 3 months ago

2. Calculate loss (per batch)

    loss = loss_fn(y_pred, y)
    train_loss += loss # accumulatively add up the loss per epoch 

I believe this is accumulatively adding up the loss per batch to get the total loss per epoch.