adding dft slides
This commit is contained in:
@@ -333,6 +333,16 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
Week 42 Constructing a Neural Network code with introduction to Tensor flow
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="exercisesweek43.html">
|
||||
Exercises weeks 43 and 44
|
||||
</a>
|
||||
</li>
|
||||
<li class="toctree-l1">
|
||||
<a class="reference internal" href="week43.html">
|
||||
Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p aria-level="2" class="caption" role="heading">
|
||||
<span class="caption-text">
|
||||
@@ -751,10 +761,10 @@ covariance matrix through the <strong>np.linalg.eig()</strong> function.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.10776220958055382
|
||||
3.743189104728408
|
||||
[[0.82379443 2.29894362]
|
||||
[2.29894362 7.75174305]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.04570437990371566
|
||||
4.420442688206847
|
||||
[[ 1.01597952 3.06059304]
|
||||
[ 3.06059304 10.1387933 ]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -794,10 +804,10 @@ a more brute force way. Here we scale the mean values for each column of the des
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.0704374681593734
|
||||
1.3273472571412799
|
||||
[[1. 0.58076367]
|
||||
[0.58076367 1. ]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.07663067400487368
|
||||
1.9423652864980914
|
||||
[[1. 0.72782592]
|
||||
[0.72782592 1. ]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -826,30 +836,30 @@ this matrix we easily see that it is a positive definite matrix.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[-0.92200223 -1.78838813]
|
||||
[-0.90854751 -2.66047048]
|
||||
[ 0.83618601 2.91748202]
|
||||
[-0.88821402 -4.10035098]
|
||||
[ 0.44781662 2.48685204]
|
||||
[ 1.20493234 2.32729105]
|
||||
[ 1.02509184 2.42265837]
|
||||
[-0.84210141 -3.82012236]
|
||||
[-0.01031541 1.40111899]
|
||||
[ 0.05715377 0.81392948]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[-0.51761523 -1.42486342]
|
||||
[ 1.91816586 6.87585634]
|
||||
[-0.34694145 -1.09920915]
|
||||
[ 0.31244861 1.08282867]
|
||||
[ 1.12441319 3.24411906]
|
||||
[-0.51892347 -1.08417181]
|
||||
[-0.54509921 -2.1148557 ]
|
||||
[ 0.26084008 0.60846694]
|
||||
[ 0.01029574 0.21049575]
|
||||
[-1.69758412 -6.29866668]]
|
||||
0 1
|
||||
0 -0.922002 -1.788388
|
||||
1 -0.908548 -2.660470
|
||||
2 0.836186 2.917482
|
||||
3 -0.888214 -4.100351
|
||||
4 0.447817 2.486852
|
||||
5 1.204932 2.327291
|
||||
6 1.025092 2.422658
|
||||
7 -0.842101 -3.820122
|
||||
8 -0.010315 1.401119
|
||||
9 0.057154 0.813929
|
||||
0 -0.517615 -1.424863
|
||||
1 1.918166 6.875856
|
||||
2 -0.346941 -1.099209
|
||||
3 0.312449 1.082829
|
||||
4 1.124413 3.244119
|
||||
5 -0.518923 -1.084172
|
||||
6 -0.545099 -2.114856
|
||||
7 0.260840 0.608467
|
||||
8 0.010296 0.210496
|
||||
9 -1.697584 -6.298667
|
||||
0 1
|
||||
0 1.000000 0.920619
|
||||
1 0.920619 1.000000
|
||||
0 1.000000 0.993148
|
||||
1 0.993148 1.000000
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -906,37 +916,37 @@ this matrix we easily see that it is a positive definite matrix.</p>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 0 1 2 3 4 5 6 7 \
|
||||
0 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
|
||||
1 0.0 0.076527 0.079731 0.075684 0.075421 0.075030 0.066467 0.065808
|
||||
2 0.0 0.079731 0.084207 0.080233 0.080607 0.080750 0.071252 0.070964
|
||||
3 0.0 0.075684 0.080233 0.079381 0.079948 0.080284 0.072483 0.072285
|
||||
4 0.0 0.075421 0.080607 0.079948 0.080953 0.081677 0.073541 0.073640
|
||||
5 0.0 0.075030 0.080750 0.080284 0.081677 0.082746 0.074340 0.074708
|
||||
6 0.0 0.066467 0.071252 0.072483 0.073541 0.074340 0.068082 0.068257
|
||||
7 0.0 0.065808 0.070964 0.072285 0.073640 0.074708 0.068257 0.068650
|
||||
8 0.0 0.065215 0.070694 0.072098 0.073720 0.075030 0.068406 0.068997
|
||||
9 0.0 0.064696 0.070461 0.071942 0.073802 0.075331 0.068551 0.069320
|
||||
10 0.0 0.057462 0.062071 0.064444 0.065735 0.066768 0.061869 0.062273
|
||||
11 0.0 0.056898 0.061747 0.064145 0.065645 0.066870 0.061826 0.062390
|
||||
12 0.0 0.056418 0.061484 0.063905 0.065593 0.066992 0.061813 0.062523
|
||||
13 0.0 0.056019 0.061281 0.063722 0.065582 0.067139 0.061833 0.062675
|
||||
14 0.0 0.055697 0.061138 0.063597 0.065614 0.067315 0.061888 0.062852
|
||||
1 0.0 0.079243 0.085251 0.080541 0.083416 0.086394 0.074010 0.075867
|
||||
2 0.0 0.085251 0.093570 0.084995 0.089008 0.093218 0.076658 0.079150
|
||||
3 0.0 0.080541 0.084995 0.088240 0.090361 0.092452 0.084878 0.086337
|
||||
4 0.0 0.083416 0.089008 0.090361 0.093080 0.095821 0.086090 0.087899
|
||||
5 0.0 0.086394 0.093218 0.092452 0.095821 0.099275 0.087175 0.089365
|
||||
6 0.0 0.074010 0.076658 0.084878 0.086090 0.087175 0.084042 0.084968
|
||||
7 0.0 0.075867 0.079150 0.086337 0.087899 0.089365 0.084968 0.086108
|
||||
8 0.0 0.077847 0.081832 0.087845 0.089793 0.091685 0.085877 0.087254
|
||||
9 0.0 0.079975 0.084740 0.089414 0.091796 0.094163 0.086774 0.088416
|
||||
10 0.0 0.067272 0.068624 0.079437 0.079971 0.080322 0.080193 0.080702
|
||||
11 0.0 0.068609 0.070338 0.080572 0.081322 0.081908 0.081000 0.081647
|
||||
12 0.0 0.070043 0.072194 0.081762 0.082754 0.083604 0.081821 0.082621
|
||||
13 0.0 0.071587 0.074211 0.083015 0.084278 0.085427 0.082657 0.083630
|
||||
14 0.0 0.073256 0.076413 0.084340 0.085908 0.087393 0.083511 0.084678
|
||||
|
||||
8 9 10 11 12 13 14
|
||||
0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
|
||||
1 0.065215 0.064696 0.057462 0.056898 0.056418 0.056019 0.055697
|
||||
2 0.070694 0.070461 0.062071 0.061747 0.061484 0.061281 0.061138
|
||||
3 0.072098 0.071942 0.064444 0.064145 0.063905 0.063722 0.063597
|
||||
4 0.073720 0.073802 0.065735 0.065645 0.065593 0.065582 0.065614
|
||||
5 0.075030 0.075331 0.066768 0.066870 0.066992 0.067139 0.067315
|
||||
6 0.068406 0.068551 0.061869 0.061826 0.061813 0.061833 0.061888
|
||||
7 0.068997 0.069320 0.062273 0.062390 0.062523 0.062675 0.062852
|
||||
8 0.069522 0.070009 0.062631 0.062894 0.063159 0.063434 0.063723
|
||||
9 0.070009 0.070645 0.062963 0.063359 0.063747 0.064134 0.064527
|
||||
10 0.062631 0.062963 0.057231 0.057361 0.057502 0.057657 0.057831
|
||||
11 0.062894 0.063359 0.057361 0.057613 0.057864 0.058121 0.058388
|
||||
12 0.063159 0.063747 0.057502 0.057864 0.058216 0.058567 0.058921
|
||||
13 0.063434 0.064134 0.057657 0.058121 0.058567 0.059004 0.059439
|
||||
14 0.063723 0.064527 0.057831 0.058388 0.058921 0.059439 0.059949
|
||||
1 0.077847 0.079975 0.067272 0.068609 0.070043 0.071587 0.073256
|
||||
2 0.081832 0.084740 0.068624 0.070338 0.072194 0.074211 0.076413
|
||||
3 0.087845 0.089414 0.079437 0.080572 0.081762 0.083015 0.084340
|
||||
4 0.089793 0.091796 0.079971 0.081322 0.082754 0.084278 0.085908
|
||||
5 0.091685 0.094163 0.080322 0.081908 0.083604 0.085427 0.087393
|
||||
6 0.085877 0.086774 0.080193 0.081000 0.081821 0.082657 0.083511
|
||||
7 0.087254 0.088416 0.080702 0.081647 0.082621 0.083630 0.084678
|
||||
8 0.088665 0.090123 0.081150 0.082248 0.083393 0.084594 0.085858
|
||||
9 0.090123 0.091913 0.081538 0.082805 0.084141 0.085557 0.087063
|
||||
10 0.081150 0.081538 0.077571 0.078106 0.078624 0.079125 0.079606
|
||||
11 0.082248 0.082805 0.078106 0.078732 0.079353 0.079969 0.080577
|
||||
12 0.083393 0.084141 0.078624 0.079353 0.080089 0.080832 0.081584
|
||||
13 0.084594 0.085557 0.079125 0.079969 0.080832 0.081718 0.082632
|
||||
14 0.085858 0.087063 0.079606 0.080577 0.081584 0.082632 0.083726
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1125,10 +1135,10 @@ We can write our own code or simply use either the functionaly of <strong>numpy<
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 0 1
|
||||
0 3.949162 1.987722
|
||||
1 1.987722 2.004480
|
||||
[[3.94916237 1.98772232]
|
||||
[1.98772232 2.00447992]]
|
||||
0 3.987648 2.034723
|
||||
1 2.034723 2.038727
|
||||
[[3.98764765 2.03472297]
|
||||
[2.03472297 2.03872663]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1155,8 +1165,8 @@ Our own code here is not very elegant and asks for obvious improvements. It is t
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Centered covariance using own code
|
||||
[[3.94916237 1.98772232]
|
||||
[1.98772232 2.00447992]]
|
||||
[[3.98764765 2.03472297]
|
||||
[2.03472297 2.03872663]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapter8_65_1.png" src="_images/chapter8_65_1.png" />
|
||||
@@ -1216,16 +1226,16 @@ questions.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Eigenvalues of Covariance matrix
|
||||
5.189621963782685
|
||||
0.7640203256838339
|
||||
5.269217029290255
|
||||
0.7571572558830478
|
||||
First eigenvector
|
||||
[0.84835621 0.52942586]
|
||||
[0.84614892 0.53294653]
|
||||
Second eigenvector
|
||||
[-0.52942586 0.84835621]
|
||||
[-0.53294653 0.84614892]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Eigenvector of largest eigenvalue
|
||||
[0.84835621 0.52942586]
|
||||
[-0.84614892 -0.53294653]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user