<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/understanding-training-loss-in-mini-batch-training-olxnw57o5" -->

---
title: Understanding Training Loss in Mini-Batch Training
description: In mini-batch training with PyTorch and PyTorch Lightning, the epoch training loss is not the total accumulated error across all samples. Instead, it is the...
canonical: https://daily.dev/posts/understanding-training-loss-in-mini-batch-training-olxnw57o5
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Understanding Training Loss in Mini-Batch Training | daily.dev
og:description: In mini-batch training with PyTorch and PyTorch Lightning, the epoch training loss is not the total accumulated error across all samples. Instead, it is the...
og:url: https://daily.dev/posts/understanding-training-loss-in-mini-batch-training-olxnw57o5
og:image: https://api.daily.dev/og/posts/oLXnW57o5.png
og:image:alt: Understanding Training Loss in Mini-Batch Training
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding Training Loss in Mini-Batch Training

**[Medium](https://daily.dev/sources/medium_js)** · 3 min read · 0 upvotes · 0 comments

## Summary

In mini-batch training with PyTorch and PyTorch Lightning, the epoch training loss is not the total accumulated error across all samples. Instead, it is the average of the individual batch losses computed during that epoch. The post explains loss functions (MSE, MAE, BCE), how datasets are divided into batches, and the step-by-step training procedure per batch including forward pass, loss calculation, backpropagation, and weight update.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@giorgi.simon/understanding-epoch-training-loss-8370a1f08ce8>

## Similar posts on daily.dev

- [Optimization: Gradient Descent to Adam](https://daily.dev/posts/optimization-gradient-descent-to-adam-ymvhymxv0) · Medium · 0 upvotes · 0 comments
- [Training with PyTorch Lightning: Structured MLOps Development](https://daily.dev/posts/training-with-pytorch-lightning-structured-mlops-development-bxyyc6oaz) · PyImageSearch · 1 upvotes · 0 comments
- [\*\*PyTorch Stochastic Gradient Optimization Technique\*\*](https://daily.dev/posts/pytorch-stochastic-gradient-optimization-technique--pslwbz3wc) · SitePoint · 1 upvotes · 1 comments
- [Backpropagation Explained for Beginners \(Part 1\): Building the Intuition](https://daily.dev/posts/backpropagation-explained-for-beginners-part-1-building-the-intuition-219g21wnz) · Towards Data Science · 0 upvotes · 0 comments

---

Tags: [#machine-learning](https://daily.dev/tags/machine-learning), [#deep-learning](https://daily.dev/tags/deep-learning), [#pytorch](https://daily.dev/tags/pytorch)

[View this post on daily.dev](https://daily.dev/posts/understanding-training-loss-in-mini-batch-training-olxnw57o5)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Understanding Training Loss in Mini-Batch Training","url":"https://daily.dev/posts/understanding-training-loss-in-mini-batch-training-olxnw57o5","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/understanding-training-loss-in-mini-batch-training-olxnw57o5"},"datePublished":"2026-08-01T22:36:07.848Z","dateModified":"2026-08-01T22:37:40.817Z","description":"In mini-batch training with PyTorch and PyTorch Lightning, the epoch training loss is not the total accumulated error across all samples. Instead, it is the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/08c65bd7e0b7d3ba69c5901e0ebffd92?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/08c65bd7e0b7d3ba69c5901e0ebffd92?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/understanding-training-loss-in-mini-batch-training-olxnw57o5","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"machine-learning,deep-learning,pytorch","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Understanding Training Loss in Mini-Batch Training"}]}
```

