Second derivative of norm of matrix power $lVert y - A^kx rVert$
$begingroup$
I am looking for the second derivative w.r.t $A$ (and $x$ and $y$, but those are a little easier):
$$
frac{partial^2}{partial A^2} frac{1}{2} lVert y - A^kx rVert_2^2
$$
I can find the first derivative with www.matrixcalculus.org:
$$
frac{partial}{partial A} frac{1}{2} lVert y - A^kx rVert_2^2 = -k cdot diag(y - A^kx)A^{k-1}cdot diag(x)
$$
But handling the "diag" operator wasn't clear. I am attempting/hoping to show that the Lipschitz constant used for gradient descent depends on $k$.
matrices matrix-calculus
$endgroup$
add a comment |
$begingroup$
I am looking for the second derivative w.r.t $A$ (and $x$ and $y$, but those are a little easier):
$$
frac{partial^2}{partial A^2} frac{1}{2} lVert y - A^kx rVert_2^2
$$
I can find the first derivative with www.matrixcalculus.org:
$$
frac{partial}{partial A} frac{1}{2} lVert y - A^kx rVert_2^2 = -k cdot diag(y - A^kx)A^{k-1}cdot diag(x)
$$
But handling the "diag" operator wasn't clear. I am attempting/hoping to show that the Lipschitz constant used for gradient descent depends on $k$.
matrices matrix-calculus
$endgroup$
$begingroup$
what does $k$ represent?
$endgroup$
– user550103
Dec 11 '18 at 11:44
$begingroup$
@user550103 - it's a scalar integer. In my particular use case, it represents "time" over which the discrete linear system described by $A$ is rolled forward. I should have put that in the question, sorry about that.
$endgroup$
– Robert
Dec 11 '18 at 18:38
add a comment |
$begingroup$
I am looking for the second derivative w.r.t $A$ (and $x$ and $y$, but those are a little easier):
$$
frac{partial^2}{partial A^2} frac{1}{2} lVert y - A^kx rVert_2^2
$$
I can find the first derivative with www.matrixcalculus.org:
$$
frac{partial}{partial A} frac{1}{2} lVert y - A^kx rVert_2^2 = -k cdot diag(y - A^kx)A^{k-1}cdot diag(x)
$$
But handling the "diag" operator wasn't clear. I am attempting/hoping to show that the Lipschitz constant used for gradient descent depends on $k$.
matrices matrix-calculus
$endgroup$
I am looking for the second derivative w.r.t $A$ (and $x$ and $y$, but those are a little easier):
$$
frac{partial^2}{partial A^2} frac{1}{2} lVert y - A^kx rVert_2^2
$$
I can find the first derivative with www.matrixcalculus.org:
$$
frac{partial}{partial A} frac{1}{2} lVert y - A^kx rVert_2^2 = -k cdot diag(y - A^kx)A^{k-1}cdot diag(x)
$$
But handling the "diag" operator wasn't clear. I am attempting/hoping to show that the Lipschitz constant used for gradient descent depends on $k$.
matrices matrix-calculus
matrices matrix-calculus
asked Dec 11 '18 at 1:03
RobertRobert
11311
11311
$begingroup$
what does $k$ represent?
$endgroup$
– user550103
Dec 11 '18 at 11:44
$begingroup$
@user550103 - it's a scalar integer. In my particular use case, it represents "time" over which the discrete linear system described by $A$ is rolled forward. I should have put that in the question, sorry about that.
$endgroup$
– Robert
Dec 11 '18 at 18:38
add a comment |
$begingroup$
what does $k$ represent?
$endgroup$
– user550103
Dec 11 '18 at 11:44
$begingroup$
@user550103 - it's a scalar integer. In my particular use case, it represents "time" over which the discrete linear system described by $A$ is rolled forward. I should have put that in the question, sorry about that.
$endgroup$
– Robert
Dec 11 '18 at 18:38
$begingroup$
what does $k$ represent?
$endgroup$
– user550103
Dec 11 '18 at 11:44
$begingroup$
what does $k$ represent?
$endgroup$
– user550103
Dec 11 '18 at 11:44
$begingroup$
@user550103 - it's a scalar integer. In my particular use case, it represents "time" over which the discrete linear system described by $A$ is rolled forward. I should have put that in the question, sorry about that.
$endgroup$
– Robert
Dec 11 '18 at 18:38
$begingroup$
@user550103 - it's a scalar integer. In my particular use case, it represents "time" over which the discrete linear system described by $A$ is rolled forward. I should have put that in the question, sorry about that.
$endgroup$
– Robert
Dec 11 '18 at 18:38
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
The tricky part is the differential
$$eqalign{
dA^k &= sum_{j=0}^{k-1} A^{j},dA,A^{k-j-1}cr
}$$
Define $w = (A^kx-y)$ and $B=A^T,,$ then find the gradient (first derivative)
$$eqalign{
phi &= tfrac{1}{2}|w|^2_2 = w:w cr
dphi &= 2w:dw = 2w:dA^kx = 2wx^T:dA^k cr
&= sum_{j=0}^{k-1} 2wx^T:A^{j},dA,A^{k-j-1} cr
&= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1}:dA cr
G=frac{partialphi}{partial A} &= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1} cr
}$$ where a colon denotes the trace/Frobenius product, i.e. $M:P={rm Tr}(M^TP)$
Note that the gradient is a matrix. That means that the Hessian (second derivative) will be a fourth-order tensor -- which is the reason why the website won't try to calculate it.
In order to calculate the Hessian, the $w$ and $B^i=(A^T)^i$ terms must be differentiated leading to a complicated double summation. Start by finding the differential of the gradient.
$$eqalign{
dG
&= 2sum_{j=0}^{k-1} &dB^{j}wx^TB^{k-j-1}+B^{j}dA^kxx^TB^{k-j-1}+B^{j}wx^TdB^{k-j-1} cr
&= 2sum_{j=0}^{k-1}Bigg(&sum_{i=0}^{j-1}B^{i},dB,B^{j-i-1}wx^TB^{k-j-1}
+ sum_{i=0}^{k-1}B^{j}A^{i},dA,A^{k-i-1}xx^TB^{k-j-1} cr
&,&+ sum_{i=0}^{k-j-2}B^{j}wx^TB^{i},dB,B^{j-i-1}
Bigg) cr
}$$
At this point you can use vectorization to flatten the matrices into vectors and calculate the Hessian as the matrix, i.e.
$$g={rm vec}(G),,,,a={rm vec}(A) implies H=frac{partial g}{partial a}$$
Or you can find the Hessian in tensor form using index notation.
Or perhaps the differential expression is sufficient for whatever purpose you have in mind.
$endgroup$
$begingroup$
This is great! Thank you! I will go through this and try to understand it more deeply. I bet I can formulate the inequality for the Lipschitz constant in terms of the differential expression: $lVert nabla phi(w_0) - nabla phi(w_1) rVert_2 leq L lVert w_0 - w_1 rVert_2$
$endgroup$
– Robert
Dec 11 '18 at 18:45
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3034724%2fsecond-derivative-of-norm-of-matrix-power-lvert-y-akx-rvert%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
The tricky part is the differential
$$eqalign{
dA^k &= sum_{j=0}^{k-1} A^{j},dA,A^{k-j-1}cr
}$$
Define $w = (A^kx-y)$ and $B=A^T,,$ then find the gradient (first derivative)
$$eqalign{
phi &= tfrac{1}{2}|w|^2_2 = w:w cr
dphi &= 2w:dw = 2w:dA^kx = 2wx^T:dA^k cr
&= sum_{j=0}^{k-1} 2wx^T:A^{j},dA,A^{k-j-1} cr
&= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1}:dA cr
G=frac{partialphi}{partial A} &= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1} cr
}$$ where a colon denotes the trace/Frobenius product, i.e. $M:P={rm Tr}(M^TP)$
Note that the gradient is a matrix. That means that the Hessian (second derivative) will be a fourth-order tensor -- which is the reason why the website won't try to calculate it.
In order to calculate the Hessian, the $w$ and $B^i=(A^T)^i$ terms must be differentiated leading to a complicated double summation. Start by finding the differential of the gradient.
$$eqalign{
dG
&= 2sum_{j=0}^{k-1} &dB^{j}wx^TB^{k-j-1}+B^{j}dA^kxx^TB^{k-j-1}+B^{j}wx^TdB^{k-j-1} cr
&= 2sum_{j=0}^{k-1}Bigg(&sum_{i=0}^{j-1}B^{i},dB,B^{j-i-1}wx^TB^{k-j-1}
+ sum_{i=0}^{k-1}B^{j}A^{i},dA,A^{k-i-1}xx^TB^{k-j-1} cr
&,&+ sum_{i=0}^{k-j-2}B^{j}wx^TB^{i},dB,B^{j-i-1}
Bigg) cr
}$$
At this point you can use vectorization to flatten the matrices into vectors and calculate the Hessian as the matrix, i.e.
$$g={rm vec}(G),,,,a={rm vec}(A) implies H=frac{partial g}{partial a}$$
Or you can find the Hessian in tensor form using index notation.
Or perhaps the differential expression is sufficient for whatever purpose you have in mind.
$endgroup$
$begingroup$
This is great! Thank you! I will go through this and try to understand it more deeply. I bet I can formulate the inequality for the Lipschitz constant in terms of the differential expression: $lVert nabla phi(w_0) - nabla phi(w_1) rVert_2 leq L lVert w_0 - w_1 rVert_2$
$endgroup$
– Robert
Dec 11 '18 at 18:45
add a comment |
$begingroup$
The tricky part is the differential
$$eqalign{
dA^k &= sum_{j=0}^{k-1} A^{j},dA,A^{k-j-1}cr
}$$
Define $w = (A^kx-y)$ and $B=A^T,,$ then find the gradient (first derivative)
$$eqalign{
phi &= tfrac{1}{2}|w|^2_2 = w:w cr
dphi &= 2w:dw = 2w:dA^kx = 2wx^T:dA^k cr
&= sum_{j=0}^{k-1} 2wx^T:A^{j},dA,A^{k-j-1} cr
&= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1}:dA cr
G=frac{partialphi}{partial A} &= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1} cr
}$$ where a colon denotes the trace/Frobenius product, i.e. $M:P={rm Tr}(M^TP)$
Note that the gradient is a matrix. That means that the Hessian (second derivative) will be a fourth-order tensor -- which is the reason why the website won't try to calculate it.
In order to calculate the Hessian, the $w$ and $B^i=(A^T)^i$ terms must be differentiated leading to a complicated double summation. Start by finding the differential of the gradient.
$$eqalign{
dG
&= 2sum_{j=0}^{k-1} &dB^{j}wx^TB^{k-j-1}+B^{j}dA^kxx^TB^{k-j-1}+B^{j}wx^TdB^{k-j-1} cr
&= 2sum_{j=0}^{k-1}Bigg(&sum_{i=0}^{j-1}B^{i},dB,B^{j-i-1}wx^TB^{k-j-1}
+ sum_{i=0}^{k-1}B^{j}A^{i},dA,A^{k-i-1}xx^TB^{k-j-1} cr
&,&+ sum_{i=0}^{k-j-2}B^{j}wx^TB^{i},dB,B^{j-i-1}
Bigg) cr
}$$
At this point you can use vectorization to flatten the matrices into vectors and calculate the Hessian as the matrix, i.e.
$$g={rm vec}(G),,,,a={rm vec}(A) implies H=frac{partial g}{partial a}$$
Or you can find the Hessian in tensor form using index notation.
Or perhaps the differential expression is sufficient for whatever purpose you have in mind.
$endgroup$
$begingroup$
This is great! Thank you! I will go through this and try to understand it more deeply. I bet I can formulate the inequality for the Lipschitz constant in terms of the differential expression: $lVert nabla phi(w_0) - nabla phi(w_1) rVert_2 leq L lVert w_0 - w_1 rVert_2$
$endgroup$
– Robert
Dec 11 '18 at 18:45
add a comment |
$begingroup$
The tricky part is the differential
$$eqalign{
dA^k &= sum_{j=0}^{k-1} A^{j},dA,A^{k-j-1}cr
}$$
Define $w = (A^kx-y)$ and $B=A^T,,$ then find the gradient (first derivative)
$$eqalign{
phi &= tfrac{1}{2}|w|^2_2 = w:w cr
dphi &= 2w:dw = 2w:dA^kx = 2wx^T:dA^k cr
&= sum_{j=0}^{k-1} 2wx^T:A^{j},dA,A^{k-j-1} cr
&= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1}:dA cr
G=frac{partialphi}{partial A} &= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1} cr
}$$ where a colon denotes the trace/Frobenius product, i.e. $M:P={rm Tr}(M^TP)$
Note that the gradient is a matrix. That means that the Hessian (second derivative) will be a fourth-order tensor -- which is the reason why the website won't try to calculate it.
In order to calculate the Hessian, the $w$ and $B^i=(A^T)^i$ terms must be differentiated leading to a complicated double summation. Start by finding the differential of the gradient.
$$eqalign{
dG
&= 2sum_{j=0}^{k-1} &dB^{j}wx^TB^{k-j-1}+B^{j}dA^kxx^TB^{k-j-1}+B^{j}wx^TdB^{k-j-1} cr
&= 2sum_{j=0}^{k-1}Bigg(&sum_{i=0}^{j-1}B^{i},dB,B^{j-i-1}wx^TB^{k-j-1}
+ sum_{i=0}^{k-1}B^{j}A^{i},dA,A^{k-i-1}xx^TB^{k-j-1} cr
&,&+ sum_{i=0}^{k-j-2}B^{j}wx^TB^{i},dB,B^{j-i-1}
Bigg) cr
}$$
At this point you can use vectorization to flatten the matrices into vectors and calculate the Hessian as the matrix, i.e.
$$g={rm vec}(G),,,,a={rm vec}(A) implies H=frac{partial g}{partial a}$$
Or you can find the Hessian in tensor form using index notation.
Or perhaps the differential expression is sufficient for whatever purpose you have in mind.
$endgroup$
The tricky part is the differential
$$eqalign{
dA^k &= sum_{j=0}^{k-1} A^{j},dA,A^{k-j-1}cr
}$$
Define $w = (A^kx-y)$ and $B=A^T,,$ then find the gradient (first derivative)
$$eqalign{
phi &= tfrac{1}{2}|w|^2_2 = w:w cr
dphi &= 2w:dw = 2w:dA^kx = 2wx^T:dA^k cr
&= sum_{j=0}^{k-1} 2wx^T:A^{j},dA,A^{k-j-1} cr
&= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1}:dA cr
G=frac{partialphi}{partial A} &= sum_{j=0}^{k-1} 2B^{j}wx^TB^{k-j-1} cr
}$$ where a colon denotes the trace/Frobenius product, i.e. $M:P={rm Tr}(M^TP)$
Note that the gradient is a matrix. That means that the Hessian (second derivative) will be a fourth-order tensor -- which is the reason why the website won't try to calculate it.
In order to calculate the Hessian, the $w$ and $B^i=(A^T)^i$ terms must be differentiated leading to a complicated double summation. Start by finding the differential of the gradient.
$$eqalign{
dG
&= 2sum_{j=0}^{k-1} &dB^{j}wx^TB^{k-j-1}+B^{j}dA^kxx^TB^{k-j-1}+B^{j}wx^TdB^{k-j-1} cr
&= 2sum_{j=0}^{k-1}Bigg(&sum_{i=0}^{j-1}B^{i},dB,B^{j-i-1}wx^TB^{k-j-1}
+ sum_{i=0}^{k-1}B^{j}A^{i},dA,A^{k-i-1}xx^TB^{k-j-1} cr
&,&+ sum_{i=0}^{k-j-2}B^{j}wx^TB^{i},dB,B^{j-i-1}
Bigg) cr
}$$
At this point you can use vectorization to flatten the matrices into vectors and calculate the Hessian as the matrix, i.e.
$$g={rm vec}(G),,,,a={rm vec}(A) implies H=frac{partial g}{partial a}$$
Or you can find the Hessian in tensor form using index notation.
Or perhaps the differential expression is sufficient for whatever purpose you have in mind.
edited Dec 11 '18 at 16:13
answered Dec 11 '18 at 13:50
greggreg
8,5051823
8,5051823
$begingroup$
This is great! Thank you! I will go through this and try to understand it more deeply. I bet I can formulate the inequality for the Lipschitz constant in terms of the differential expression: $lVert nabla phi(w_0) - nabla phi(w_1) rVert_2 leq L lVert w_0 - w_1 rVert_2$
$endgroup$
– Robert
Dec 11 '18 at 18:45
add a comment |
$begingroup$
This is great! Thank you! I will go through this and try to understand it more deeply. I bet I can formulate the inequality for the Lipschitz constant in terms of the differential expression: $lVert nabla phi(w_0) - nabla phi(w_1) rVert_2 leq L lVert w_0 - w_1 rVert_2$
$endgroup$
– Robert
Dec 11 '18 at 18:45
$begingroup$
This is great! Thank you! I will go through this and try to understand it more deeply. I bet I can formulate the inequality for the Lipschitz constant in terms of the differential expression: $lVert nabla phi(w_0) - nabla phi(w_1) rVert_2 leq L lVert w_0 - w_1 rVert_2$
$endgroup$
– Robert
Dec 11 '18 at 18:45
$begingroup$
This is great! Thank you! I will go through this and try to understand it more deeply. I bet I can formulate the inequality for the Lipschitz constant in terms of the differential expression: $lVert nabla phi(w_0) - nabla phi(w_1) rVert_2 leq L lVert w_0 - w_1 rVert_2$
$endgroup$
– Robert
Dec 11 '18 at 18:45
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3034724%2fsecond-derivative-of-norm-of-matrix-power-lvert-y-akx-rvert%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
what does $k$ represent?
$endgroup$
– user550103
Dec 11 '18 at 11:44
$begingroup$
@user550103 - it's a scalar integer. In my particular use case, it represents "time" over which the discrete linear system described by $A$ is rolled forward. I should have put that in the question, sorry about that.
$endgroup$
– Robert
Dec 11 '18 at 18:38