Confusion related to derivative

37 Views Asked by At

What is the gradient of $||x + b||_1$ with respect to $x$? Here $x$ is the variable and $b$ is the constant.

1

There are 1 best solutions below

1
On

Hint: Write $x=(x_1,\ldots,x_n)$ to help you see it as a function of several variables. Then $$ ||x + b||_1 = |x_1+b_1|+\cdots+|x_n+b_n|. $$

Now do you see how to find $\frac{\partial}{\partial x_i}||x+b||_1$? Try $n=1$. What is the derivative of $|x+b|$?

Hint 2: It doesn't exist everywhere!