Skip to main content
added 9 characters in body
Source Link

The closed-loop dynamics of a linear optimal controller are simple but have interesting properties. From a starting state $\mathbf{v}(0)$ the dynamic can be iterated to reach a final state $\mathbf{v}(N)$ as in

$$ v(n) = (A - BC)^N\mathbf{v}(0). $$$$ \mathbf{v}(N) = (A - BC)^N\mathbf{v}(0). $$

I would like to optimize the transition parameter matrix $A$ through gradient descent with rate $\eta$:

$$ A' = A - \eta\frac{df}{dA} $$

with loss function $f$ is the error between a generic resultant state $(A - BC)^N\mathbf{v}$ and a target state $\mathbf{w}$. $\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of this scalar loss function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives.

The closed-loop dynamics of a linear optimal controller are simple but have interesting properties. From a starting state $\mathbf{v}(0)$ the dynamic can be iterated to reach a final state $\mathbf{v}(N)$ as in

$$ v(n) = (A - BC)^N\mathbf{v}(0). $$

I would like to optimize the transition parameter matrix $A$ through gradient descent with rate $\eta$:

$$ A' = A - \eta\frac{df}{dA} $$

with loss function $f$ is the error between a generic resultant state $(A - BC)^N\mathbf{v}$ and a target state $\mathbf{w}$. $\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of this scalar loss function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives.

The closed-loop dynamics of a linear optimal controller are simple but have interesting properties. From a starting state $\mathbf{v}(0)$ the dynamic can be iterated to reach a final state $\mathbf{v}(N)$ as in

$$ \mathbf{v}(N) = (A - BC)^N\mathbf{v}(0). $$

I would like to optimize the transition parameter matrix $A$ through gradient descent with rate $\eta$:

$$ A' = A - \eta\frac{df}{dA} $$

with loss function $f$ is the error between a generic resultant state $(A - BC)^N\mathbf{v}$ and a target state $\mathbf{w}$. $\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of this scalar loss function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives.

added 384 characters in body; edited title
Source Link

Matrix power derivative Gradient Descent for Markov Dynamics

The closed-loop dynamics of a linear optimal controller are simple but have interesting properties. From a starting state $\mathbf{v}(0)$ the dynamic can be iterated to reach a final state $\mathbf{v}(N)$ as in

$$ v(n) = (A - BC)^N\mathbf{v}(0). $$

I would like to optimize the transition parameter matrix $A$ through gradient descent with rate $\eta$:

$$ A' = A - \eta\frac{df}{dA} $$

with loss function $f$ is the error between a generic resultant state $(A - BC)^N\mathbf{v}$ and a target state $\mathbf{w}$. $\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of athis scalar loss function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives. Since the function is scalar, the scalar-by-matrix derivative rules should be clear, but I'm struggling to get started on the matrix-by-matrix, chain rule derivatives.

Matrix power derivative

$\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of a scalar function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives. Since the function is scalar, the scalar-by-matrix derivative rules should be clear, but I'm struggling to get started on the matrix-by-matrix, chain rule derivatives.

Gradient Descent for Markov Dynamics

The closed-loop dynamics of a linear optimal controller are simple but have interesting properties. From a starting state $\mathbf{v}(0)$ the dynamic can be iterated to reach a final state $\mathbf{v}(N)$ as in

$$ v(n) = (A - BC)^N\mathbf{v}(0). $$

I would like to optimize the transition parameter matrix $A$ through gradient descent with rate $\eta$:

$$ A' = A - \eta\frac{df}{dA} $$

with loss function $f$ is the error between a generic resultant state $(A - BC)^N\mathbf{v}$ and a target state $\mathbf{w}$. $\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of this scalar loss function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives.

Post Closed as "Not suitable for this site" by Federico Poloni, LSpice, abx, David Handelman, Alex M.
edited body
Source Link

$\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of a scalar function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ q(X) & {}= (X-BC)^N. \end{align*}\begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives. Since the function is scalar, the scalar-by-matrix derivative rules should be clear, but I'm struggling to get started on the matrix-by-matrix, chain rule derivatives.

$\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of a scalar function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ q(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives. Since the function is scalar, the scalar-by-matrix derivative rules should be clear, but I'm struggling to get started on the matrix-by-matrix, chain rule derivatives.

$\newcommand\norm[1]{\lVert#1\rVert}$I'm struggling to find the derivative $\frac{\partial{f(A)}}{\partial{A}}$ of a scalar function (L2 norm) $$ f(A) = \norm{(A - BC)^N\mathbf{v} - \mathbf{w}}_2^2 $$ where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$, $C\in\mathbb{R}^{m\times n}$, and $\mathbf{v},\mathbf{w}\in\mathbb{R}^{n}$.

Using chain rule, I can write this as $$ \frac{\partial{f(X)}}{\partial{X}} = \frac{\partial{f(X)}}{\partial{g(X)}} \frac{\partial{g(X)}}{\partial{h(X)}} \frac{\partial{h(X)}}{\partial{X}} $$ where \begin{align*} f(X) & {}= g(h(X)) \\ g(X) & {}= \norm{X\mathbf{v} - \mathbf{w}}_2^2 \\ h(X) & {}= (X-BC)^N. \end{align*}

The problem is, I'm not clear on how to take these these intermediate derivatives. Since the function is scalar, the scalar-by-matrix derivative rules should be clear, but I'm struggling to get started on the matrix-by-matrix, chain rule derivatives.

TeX
Source Link
LSpice
  • 12.9k
  • 4
  • 45
  • 69
Loading
edited tags
Link
Federico Poloni
  • 20.2k
  • 2
  • 82
  • 120
Loading
removed spurious )
Source Link
Carlo Beenakker
  • 188.1k
  • 18
  • 448
  • 651
Loading
Removed superfluous derivative
Source Link
Loading
Source Link
Loading