TransWikia.com

When using Absolute Error in Gradient Descent, how to calculate the derivative?

Data Science Asked by user3656142 on April 5, 2021

What is the derivative of the Loss Function (Absolute Error) with respect to the feature weights that is used to update the weights?

Couldn’t find anything specific about it anywhere.

2 Answers

MAE is not continuous in $y_{pred} = y_{true}$ and therefore there is no defined (bounded, direction independent) derivative at that point.

Elsewhere you have +1, where $y_{pred} > y_{true}$ and -1 where $y_{pred} < y_{true}$

Usually frameworks like TensorFlow, Keras, etc... use an approximate derivative for that point.

Correct answer by Philipp on April 5, 2021

You can simply approximate $f(x)=|x|$ by $f(x)=sqrt{x^2+c}$ where $c>0$. You can also utilize subderivative method.

Answered by Media on April 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP