Update week35.do.txt

This commit is contained in:
Morten Hjorth-Jensen
2023-08-27 21:33:20 +02:00
parent db912fc7df
commit a3609edbdb
+52 -1
View File
@@ -570,7 +570,9 @@ From this we have, using the definition of the Jacobian
!split
===== Example 2 =====
We define a scalar (our cast functions are in general also scalars, think of the mean squared error) as the result of some matrix vector multiplications
We define a scalar (our cost/loss functions are in general also scalars,
just think of the mean squared error) as the result of some matrix vector
multiplications
!bt
\[
@@ -601,6 +603,55 @@ Since $\alpha$ is a scalar we have $\alpha =\alpha^T=\bm{x}^T\bm{A}^T\bm{y}$. De
!split
===== Example 3 =====
We start with a new scalar but where now the vector $\bm{y}$ is
replaced by a vector $\bm{x}$ and the matrix $\bm{A}$ is a square
matrix with dimension $n\times n$.
!bt
\[
\alpha = \bm{x}^T\bm{A}\bm{x}$,
\]
!et
with $\bm{x}$ a vector of length $n$.
We write out the specific sums involved in the calculation of $\alpha$
!bt
\[
\alpha = \sum_{i=0}^{n-1}\sum_{j=0}^({n-1}x_i a_{ij}x_j,
\]
!et
taking the derivative of $\alpha$ with respect to a given component $x_k$ we get the two sums
!bt
\[
\frac{\partial \alpha}{\partial x_k} = \sum_{i=0}^{n-1}a_{ik}x_i+\sum_{j=0}^{n-1}a_{kj}x_j,
\]
!et
for $\all k =0,1,2,\dots,n-1$. We identify these sums as
!bt
\[
\frac{\partial \alpha}{\partial \bm{x}} = \bm{x}^T\left(\bm{A}^T+\bm{A}\right).
\]
!et
If the matrix $\bm{A}$ is symmetric, that is $\bm{A}=\bm{A}^T$, we have
!bt
\[
\frac{\partial \alpha}{\partial \bm{x}} = 2\bm{x}^T\bm{A}.
\]
!et
!split
===== Example 4 =====
We let the scalar $\alpha$ be defined by
!bt
\[
\alpha = \bm{y}^T\bm{x},
\]
!et
where both $\bm{y}$ and $\bm{x}$ have the same length $n$, or if we wish to think of them as column vectors, they have dimensions $n\times 1$
!bt
\[