Skip to content

Commit 48989cd

Browse files
committed
Fix MSE's derivative and update a Wikipedia link
1 parent 26dce15 commit 48989cd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

content/anarchycorner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ draft: false
77

88
---
99

10-
Being burnt out absolutely SUCKS.
10+
Being burnt out absolutely SUCKS.
1111
<sub><sup>15/03/2025</sup></sub>
1212

1313
---

content/posts/a_neat_error_function_approximation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ The first term on right-hand side is computable, we used the mean squared error
282282
$$L(\hat{y})=MSE(\hat{y})=\frac{1}{N}\sum_{i=1}^{N}\left(y_{i} - \hat{y_{i}}\right)^{2} $$
283283

284284
So that means
285-
$$\frac{\partial{L}}{\partial{\hat{y_{i}}}} = \frac{-2}{N}(y_{i}-\hat{y_{i}}) $$
285+
$$\frac{\partial{L}}{\partial{\hat{y_{i}}}} = \frac{-2}{N} \sum_{i=1}^{N} \left(y_{i}-\hat{y_{i}}\right) $$
286286

287287
PS: If the subscript \\(i\\) confuses you, please remember that \\(\hat{y}\\) is not a single prediction but a vector of predictions since when training a model we use fixed batches of data. So the \\(\hat{y_{i}}\\)
288288
there represents the current prediction.
@@ -428,5 +428,5 @@ print(f"At x={x_error}")
428428
```
429429
![Max absolute error](/content/max_abs_error.png)
430430

431-
So the absolute error is about \\(5\cdot10^{-5}\\) which is pretty nice, it beats an approximation that is on the [Wikipedia page](https://en.wikipedia.org/wiki/Error_function#Numerical_approximations) for the error function
431+
So the absolute error is about \\(5\cdot10^{-5}\\) which is pretty nice, it beats an approximation that is on the [Wikipedia page](https://en.wikipedia.org/wiki/Error_function#Bounds_and_Numerical_approximations) for the error function
432432
and comes really close to another one. I've had a lot of fun working on this and writing this blog post. [Here's](https://www.desmos.com/calculator/qyppxo0okg) a desmos link if you want to play with the formula yourself.

0 commit comments

Comments
 (0)