Gradient of ||f(x)||^2

  • #1
perplexabot
Gold Member
329
5
Hey,
I have been trying to figure out how to solve [itex]\triangledown_x ||f(x)||^2_2[/itex].
I have used the chain rule (hopefully correctly) to get the following:
[tex]\triangledown_x ||f(x)||^2_2=2\triangledown_xf(x)^T \frac{f(x)^T}{||f(x)||_2}[/tex]
Is this correct?

The reason I doubt my answer is because I know the gradient of a scalar valued function should be a vector. My answer seems to give a scalar. Can anyone please shed some light...

Note: [itex]x \in \Re^n[/itex] and I am using the convection that the gradient, [itex]\triangledown_x[/itex], of a function is a row vector. Also assume [itex]f: \Re^n\rightarrow \Re^m[/itex] .
 
Last edited:

Answers and Replies

  • #2
perplexabot
Gold Member
329
5
So, I was washing the dishes when I realized that [tex]2\triangledown_xf(x)^T \frac{f(x)^T}{||f(x)||_2}[/tex] is not a scalar. This is because [itex]\triangledown_xf(x)^T[/itex] is a matrix (this is actually the jacobian!). So now I have a feeling the above may be close, but still wrong. I would appreciate a confirmation tho.

Thank you :)

EDIT: Just realized this is my 300th post!!! YAY me! Love you physics forums!
 
Last edited:
  • #3
perplexabot
Gold Member
329
5
So I have made a couple of fixes, specifically making sure the matrix multiplaction agrees "dimensionally" [tex]\triangledown_x ||f(x)||^2_2=\frac{2f(x)^T}{||f(x)||_2}(\triangledown_xf(x))[/tex]
I wonder if this is correct now. Anyone?
 
  • #4
perplexabot
Gold Member
329
5
My work is wrong! Here is the correct method for the sake of completeness.
[tex]
\begin{equation*}
\begin{split}
\triangledown_x ||f(x)||^2_2 &=\triangledown_x (f(x)^Tf(x)) \\
&=(\triangledown_xf(x)^T)^Tf(x)+(\triangledown_xf(x))^Tf(x) \\
&=(\triangledown_xf(x))^Tf(x)+(\triangledown_xf(x))^Tf(x) \\
&=2(\triangledown_xf(x))^Tf(x)
\end{split}
\end{equation*}
[/tex]

Thank you all for reading.
EDIT: Also here and here are some references I used.
 

Related Threads on Gradient of ||f(x)||^2

Replies
3
Views
3K
  • Last Post
Replies
4
Views
2K
Replies
11
Views
2K
  • Poll
  • Last Post
2
Replies
31
Views
5K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
3
Views
798
  • Last Post
Replies
4
Views
12K
  • Last Post
Replies
4
Views
2K
Top