From ddda79f44973a00d0df9d784c229ae6c45bedea1 Mon Sep 17 00:00:00 2001 From: Morten Hjorth-Jensen Date: Thu, 2 Sep 2021 09:41:54 +0200 Subject: [PATCH] updating week 35 --- doc/pub/week35/html/week35-reveal.html | 12 ++++++------ doc/pub/week35/html/week35-solarized.html | 12 ++++++------ doc/pub/week35/html/week35.html | 12 ++++++------ doc/pub/week35/ipynb/ipynb-week35-src.tar.gz | Bin 192 -> 190 bytes doc/pub/week35/ipynb/week35.ipynb | 12 ++++++------ doc/src/week35/week35.do.txt | 12 ++++++------ 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/doc/pub/week35/html/week35-reveal.html b/doc/pub/week35/html/week35-reveal.html index 72dba7a8b..d048589fb 100644 --- a/doc/pub/week35/html/week35-reveal.html +++ b/doc/pub/week35/html/week35-reveal.html @@ -1719,7 +1719,7 @@ As an example, the above defective matrix can be decomposed as

 
$$ -\boldsymbol{X} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1& 1 \\ 1& -1\\ \end{bmatrix} \begin{bmatrix} 4& 0 \\ 0& 0\\ \end{bmatrix} \frac{1}{\sqrt{2}}\begin{bmatrix} 1& -1 \\ 1& 1\\ \end{bmatrix}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T, +\boldsymbol{X} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1& 1 \\ 1& -1\\ \end{bmatrix} \begin{bmatrix} 2& 0 \\ 0& 0\\ \end{bmatrix} \frac{1}{\sqrt{2}}\begin{bmatrix} 1& -1 \\ 1& 1\\ \end{bmatrix}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T, $$

 
@@ -1788,7 +1788,7 @@ In general the economy-size SVD leads to less FLOPS and still conserving the des SVD is numerically more stable than the inversion algorithms provided by numpy and scipy.linalg at the cost of being slower. ''' - U, S, VT = np.linalg.svd(A) + U, S, VT = np.linalg.svd(A,full_matrices=True) print('test U') print( (np.transpose(U) @ U - U @np.transpose(U))) print('test VT') @@ -1804,12 +1804,12 @@ In general the economy-size SVD leads to less FLOPS and still conserving the des X = np.array([ [1.0,-1.0], [1.0,-1.0]]) +#X = np.array([[1, 2], [3, 4], [5, 6]]) + print(X) -A = np.transpose(X) @ X -print(A) -C = SVDinv(A) +C = SVDinv(X) # Print the difference between the original matrix and the SVD one -print(C-A) +print(C-X)

The matrix \( \boldsymbol{X} \) has columns that are linearly dependent. The first diff --git a/doc/pub/week35/html/week35-solarized.html b/doc/pub/week35/html/week35-solarized.html index 7f77448c1..ea56572cd 100644 --- a/doc/pub/week35/html/week35-solarized.html +++ b/doc/pub/week35/html/week35-solarized.html @@ -1794,7 +1794,7 @@ $$ As an example, the above defective matrix can be decomposed as $$ -\boldsymbol{X} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1& 1 \\ 1& -1\\ \end{bmatrix} \begin{bmatrix} 4& 0 \\ 0& 0\\ \end{bmatrix} \frac{1}{\sqrt{2}}\begin{bmatrix} 1& -1 \\ 1& 1\\ \end{bmatrix}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T, +\boldsymbol{X} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1& 1 \\ 1& -1\\ \end{bmatrix} \begin{bmatrix} 2& 0 \\ 0& 0\\ \end{bmatrix} \frac{1}{\sqrt{2}}\begin{bmatrix} 1& -1 \\ 1& 1\\ \end{bmatrix}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T, $$

@@ -1862,7 +1862,7 @@ In general the economy-size SVD leads to less FLOPS and still conserving the des SVD is numerically more stable than the inversion algorithms provided by numpy and scipy.linalg at the cost of being slower. ''' - U, S, VT = np.linalg.svd(A) + U, S, VT = np.linalg.svd(A,full_matrices=True) print('test U') print( (np.transpose(U) @ U - U @np.transpose(U))) print('test VT') @@ -1878,12 +1878,12 @@ In general the economy-size SVD leads to less FLOPS and still conserving the des X = np.array([ [1.0,-1.0], [1.0,-1.0]]) +#X = np.array([[1, 2], [3, 4], [5, 6]]) + print(X) -A = np.transpose(X) @ X -print(A) -C = SVDinv(A) +C = SVDinv(X) # Print the difference between the original matrix and the SVD one -print(C-A) +print(C-X)

The matrix \( \boldsymbol{X} \) has columns that are linearly dependent. The first diff --git a/doc/pub/week35/html/week35.html b/doc/pub/week35/html/week35.html index 5b00624c0..10114f03e 100644 --- a/doc/pub/week35/html/week35.html +++ b/doc/pub/week35/html/week35.html @@ -1799,7 +1799,7 @@ $$ As an example, the above defective matrix can be decomposed as $$ -\boldsymbol{X} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1& 1 \\ 1& -1\\ \end{bmatrix} \begin{bmatrix} 4& 0 \\ 0& 0\\ \end{bmatrix} \frac{1}{\sqrt{2}}\begin{bmatrix} 1& -1 \\ 1& 1\\ \end{bmatrix}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T, +\boldsymbol{X} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1& 1 \\ 1& -1\\ \end{bmatrix} \begin{bmatrix} 2& 0 \\ 0& 0\\ \end{bmatrix} \frac{1}{\sqrt{2}}\begin{bmatrix} 1& -1 \\ 1& 1\\ \end{bmatrix}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T, $$

@@ -1867,7 +1867,7 @@ In general the economy-size SVD leads to less FLOPS and still conserving the des SVD is numerically more stable than the inversion algorithms provided by numpy and scipy.linalg at the cost of being slower. ''' - U, S, VT = np.linalg.svd(A) + U, S, VT = np.linalg.svd(A,full_matrices=True) print('test U') print( (np.transpose(U) @ U - U @np.transpose(U))) print('test VT') @@ -1883,12 +1883,12 @@ In general the economy-size SVD leads to less FLOPS and still conserving the des X = np.array([ [1.0,-1.0], [1.0,-1.0]]) +#X = np.array([[1, 2], [3, 4], [5, 6]]) + print(X) -A = np.transpose(X) @ X -print(A) -C = SVDinv(A) +C = SVDinv(X) # Print the difference between the original matrix and the SVD one -print(C-A) +print(C-X)

The matrix \( \boldsymbol{X} \) has columns that are linearly dependent. The first diff --git a/doc/pub/week35/ipynb/ipynb-week35-src.tar.gz b/doc/pub/week35/ipynb/ipynb-week35-src.tar.gz index 6fef7343b68fe044c340760e38c0ebd231fb8e19..8af419c5e86d91d5ba4cb7709208b10780e519f5 100644 GIT binary patch literal 190 zcmV;v073sBiwFQSfG}YI1MSaE3c@fD1>mlGia9~a*ru)pUAPcLyg*8)Hr6IJNzvZk z{(!C&H${Ye1Rf!eFmu?f*1JvQ?k<=OV=PS)7;>5NG1+3ej}SRvg8dnqF))ldVgPKu zkzQKsgy~1A%QGoU>Rqp|6~%{trd8mXf8tn53)_9?O07U?N14_Y+=!}}N3!Wu2Dv6X sJb|HWD-D5A9f&-aPHH7CVPo{kh}uTsub1&W&-1?a05Ugk6#xhT05E1%7ytkO literal 192 zcmV;x06+g9iwFRIc`#uB1MSbv3c@f92k@Qu6nTQtx^_DY?%+WX@dY}TxjNU*wnO*! z?gR9sco`z}cli?%LUPE~n_U*Uy9*XW2uT=&G1G)kNmg?`p_Btl$u|b<88#_9}-$ uqa9md@Y+d(AXE>cD5R5GiA&fTeKMl4QTXd;JkRsIuRQ=lo?-O>2mk