---
title: "Discussion on \"Part 25: Loss Function Explained: How Does a Neural Network Know It Is Wrong?\" | Hashnode"
description: "Discussion on \"Part 25: Loss Function Explained: How Does a Neural Network Know It Is Wrong?\". Understand how loss functions measure prediction errors and help machine learning models learn from their mistakes."
url: "https://hashnode.com/posts/loss-function-explained/6ad2125a53169bf57c05fa72"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Part 25: Loss Function Explained: How Does a Neural Network Know It Is Wrong?](https://ai-beginners-journey.hashnode.dev/loss-function-explained?utm_source=hashnode&utm_medium=feed)

Understand how loss functions measure prediction errors and help machine learning models learn from their mistakes.

Oct 16 · 5 min read · ai-beginners-journey.hashnode.dev  
Read the article

-   [#machine-learning](https://hashnode.com/tag/machine-learning)
-   [#ai](https://hashnode.com/tag/ai)
-   [#artificial-intelligence](https://hashnode.com/tag/artificial-intelligence)
-   [#deeplearning](https://hashnode.com/tag/deeplearning)
-   [#loss-functions](https://hashnode.com/tag/loss-functions)
-   [#tech](https://hashnode.com/tag/tech)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Divyajot Kaur](https://hashnode.com/@djk2004)

@djk2004

  
[View profile](https://hashnode.com/@djk2004)

## Responses 1

Markdown supported · ⌘↵ to post

[Yunus Emre Vurgun](https://hashnode.com/@yunusemrevurgun)

[Oct 16](https://hashnode.com/posts/loss-function-explained/6ad2125a53169bf57c05fa72/comment/6ad25da2aa3455827cf29b8c)

Nice clear walkthrough. A small worked example that helps MSE vs MAE click: take errors of 1, 1, 1 and 10 (in lakh). MAE = (1+1+1+10)/4 = 3.25, while MSE = (1+1+1+100)/4 = 25.75. The one big miss dominates MSE, which is why it punishes outliers hard and why MAE is more robust when your data has a few odd prices. A practical middle ground is Huber loss: it behaves like MSE for small errors and like MAE for large ones. And for cross-entropy, a fun check: a confident wrong answer (p=0.01 for the true class) costs about 4.6, versus about 0.69 for an unsure p=0.5.
