adding dft slides
@@ -10,13 +10,13 @@ edge [fontname="helvetica"] ;
|
||||
2 -> 3 ;
|
||||
4 [label="gini = 0.0\nsamples = 239\nvalue = [[239, 0]\n[0, 239]]", fillcolor="#e58139"] ;
|
||||
3 -> 4 ;
|
||||
5 [label="worst compactness <= 0.085\ngini = 0.444\nsamples = 3\nvalue = [[2, 1]\n[1, 2]]", fillcolor="#fdf6f0"] ;
|
||||
5 [label="worst smoothness <= 0.107\ngini = 0.444\nsamples = 3\nvalue = [[2, 1]\n[1, 2]]", fillcolor="#fdf6f0"] ;
|
||||
3 -> 5 ;
|
||||
6 [label="gini = 0.0\nsamples = 1\nvalue = [[0, 1]\n[1, 0]]", fillcolor="#e58139"] ;
|
||||
6 [label="gini = 0.0\nsamples = 2\nvalue = [[2, 0]\n[0, 2]]", fillcolor="#e58139"] ;
|
||||
5 -> 6 ;
|
||||
7 [label="gini = 0.0\nsamples = 2\nvalue = [[2, 0]\n[0, 2]]", fillcolor="#e58139"] ;
|
||||
7 [label="gini = 0.0\nsamples = 1\nvalue = [[0, 1]\n[1, 0]]", fillcolor="#e58139"] ;
|
||||
5 -> 7 ;
|
||||
8 [label="mean texture <= 20.84\ngini = 0.397\nsamples = 11\nvalue = [[8, 3]\n[3, 8]]", fillcolor="#fae9dd"] ;
|
||||
8 [label="worst texture <= 29.455\ngini = 0.397\nsamples = 11\nvalue = [[8, 3]\n[3, 8]]", fillcolor="#fae9dd"] ;
|
||||
2 -> 8 ;
|
||||
9 [label="gini = 0.0\nsamples = 8\nvalue = [[8, 0]\n[0, 8]]", fillcolor="#e58139"] ;
|
||||
8 -> 9 ;
|
||||
@@ -30,11 +30,11 @@ edge [fontname="helvetica"] ;
|
||||
11 -> 13 ;
|
||||
14 [label="worst texture <= 20.645\ngini = 0.202\nsamples = 167\nvalue = [[19, 148]\n[148, 19]]", fillcolor="#f0b68c"] ;
|
||||
0 -> 14 [labeldistance=2.5, labelangle=-45, headlabel="False"] ;
|
||||
15 [label="worst radius <= 17.74\ngini = 0.375\nsamples = 16\nvalue = [[12, 4]\n[4, 12]]", fillcolor="#f9e3d4"] ;
|
||||
15 [label="worst concavity <= 0.318\ngini = 0.375\nsamples = 16\nvalue = [[12, 4]\n[4, 12]]", fillcolor="#f9e3d4"] ;
|
||||
14 -> 15 ;
|
||||
16 [label="gini = 0.0\nsamples = 11\nvalue = [[11, 0]\n[0, 11]]", fillcolor="#e58139"] ;
|
||||
15 -> 16 ;
|
||||
17 [label="fractal dimension error <= 0.002\ngini = 0.32\nsamples = 5\nvalue = [[1, 4]\n[4, 1]]", fillcolor="#f6d5bd"] ;
|
||||
17 [label="radius error <= 0.251\ngini = 0.32\nsamples = 5\nvalue = [[1, 4]\n[4, 1]]", fillcolor="#f6d5bd"] ;
|
||||
15 -> 17 ;
|
||||
18 [label="gini = 0.0\nsamples = 1\nvalue = [[1, 0]\n[0, 1]]", fillcolor="#e58139"] ;
|
||||
17 -> 18 ;
|
||||
|
||||
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 244 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 27 KiB |
@@ -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">
|
||||
@@ -1066,13 +1076,13 @@ example of the functionality of <strong>Scikit-Learn</strong>.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The intercept alpha:
|
||||
[2.04828291]
|
||||
[1.95815651]
|
||||
Coefficient beta :
|
||||
[[4.85601654]]
|
||||
Mean squared error: 0.27
|
||||
Variance score: 0.89
|
||||
[[5.03219974]]
|
||||
Mean squared error: 0.26
|
||||
Variance score: 0.90
|
||||
Mean squared log error: 0.01
|
||||
Mean absolute error: 0.40
|
||||
Mean absolute error: 0.41
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapter1_19_1.png" src="_images/chapter1_19_1.png" />
|
||||
@@ -1172,7 +1182,7 @@ a linear <span class="math notranslate nohighlight">\(x\)</span>-dependence we s
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<img alt="_images/chapter1_33_0.png" src="_images/chapter1_33_0.png" />
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.005000000000000001
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.004999999999999996
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
@@ -1383,7 +1393,7 @@ the <em>Hadamard product</em>, meaning element-wise multiplication.</p>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Old accuracy on training data: 0.1440501043841336
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1717,7 +1727,7 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.19166666666666668
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1726,7 +1736,7 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1735,7 +1745,7 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1744,7 +1754,7 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1753,7 +1763,7 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1762,7 +1772,7 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1771,7 +1781,7 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1780,11 +1790,11 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.09166666666666666
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1793,11 +1803,11 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1806,11 +1816,11 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1819,11 +1829,11 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1832,11 +1842,11 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1845,7 +1855,7 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1854,11 +1864,11 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1867,11 +1877,11 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1880,11 +1890,11 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1893,11 +1903,11 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1906,11 +1916,11 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1919,11 +1929,11 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1932,11 +1942,11 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1945,17 +1955,38 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10904/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 10.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
|
||||
<span class="ne">KeyboardInterrupt</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
|
||||
<span class="nn">Input In [8],</span> in <span class="ni"><cell line: 7></span><span class="nt">()</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">8</span> <span class="k">for</span> <span class="n">j</span><span class="p">,</span> <span class="n">lmbd</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">lmbd_vals</span><span class="p">):</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">9</span> <span class="n">dnn</span> <span class="o">=</span> <span class="n">NeuralNetwork</span><span class="p">(</span><span class="n">X_train</span><span class="p">,</span> <span class="n">Y_train_onehot</span><span class="p">,</span> <span class="n">eta</span><span class="o">=</span><span class="n">eta</span><span class="p">,</span> <span class="n">lmbd</span><span class="o">=</span><span class="n">lmbd</span><span class="p">,</span> <span class="n">epochs</span><span class="o">=</span><span class="n">epochs</span><span class="p">,</span> <span class="n">batch_size</span><span class="o">=</span><span class="n">batch_size</span><span class="p">,</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">10</span> <span class="n">n_hidden_neurons</span><span class="o">=</span><span class="n">n_hidden_neurons</span><span class="p">,</span> <span class="n">n_categories</span><span class="o">=</span><span class="n">n_categories</span><span class="p">)</span>
|
||||
<span class="ne">---> </span><span class="mi">11</span> <span class="n">dnn</span><span class="o">.</span><span class="n">train</span><span class="p">()</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">13</span> <span class="n">DNN_numpy</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="n">dnn</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">15</span> <span class="n">test_predict</span> <span class="o">=</span> <span class="n">dnn</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">X_test</span><span class="p">)</span>
|
||||
|
||||
<span class="nn">Input In [6],</span> in <span class="ni">NeuralNetwork.train</span><span class="nt">(self)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">95</span> <span class="bp">self</span><span class="o">.</span><span class="n">X_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">X_data_full</span><span class="p">[</span><span class="n">chosen_datapoints</span><span class="p">]</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">96</span> <span class="bp">self</span><span class="o">.</span><span class="n">Y_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">Y_data_full</span><span class="p">[</span><span class="n">chosen_datapoints</span><span class="p">]</span>
|
||||
<span class="ne">---> </span><span class="mi">98</span> <span class="bp">self</span><span class="o">.</span><span class="n">feed_forward</span><span class="p">()</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">99</span> <span class="bp">self</span><span class="o">.</span><span class="n">backpropagation</span><span class="p">()</span>
|
||||
|
||||
<span class="nn">Input In [6],</span> in <span class="ni">NeuralNetwork.feed_forward</span><span class="nt">(self)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">36</span> <span class="k">def</span> <span class="nf">feed_forward</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">37</span> <span class="c1"># feed-forward for training</span>
|
||||
<span class="ne">---> </span><span class="mi">38</span> <span class="bp">self</span><span class="o">.</span><span class="n">z_h</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">matmul</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">X_data</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">hidden_weights</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">hidden_bias</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">39</span> <span class="bp">self</span><span class="o">.</span><span class="n">a_h</span> <span class="o">=</span> <span class="n">sigmoid</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">z_h</span><span class="p">)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">41</span> <span class="bp">self</span><span class="o">.</span><span class="n">z_o</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">matmul</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">a_h</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">output_weights</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">output_bias</span>
|
||||
|
||||
<span class="ne">KeyboardInterrupt</span>:
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2001,22 +2032,6 @@ Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31563/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapter10_59_1.png" src="_images/chapter10_59_1.png" />
|
||||
<img alt="_images/chapter10_59_2.png" src="_images/chapter10_59_2.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="scikit-learn-implementation">
|
||||
@@ -2052,329 +2067,6 @@ performance overall.</p>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1e-05
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.18333333333333332
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1e-05
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.18611111111111112
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1e-05
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.13055555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1e-05
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.24444444444444444
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1e-05
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.23333333333333334
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1e-05
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.12777777777777777
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1e-05
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.1527777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.9111111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.8888888888888888
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.8722222222222222
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.8305555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.8888888888888888
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.8805555555555555
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.8944444444444445
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.001
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.975
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.001
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.9777777777777777
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.001
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.9805555555555555
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.001
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.9861111111111112
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.001
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.9805555555555555
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.001
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.9777777777777777
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.001
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.9444444444444444
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.9861111111111112
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.9888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.9888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.9861111111111112
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.9888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.9722222222222222
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.9527777777777777
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.1
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.9027777777777778
|
||||
|
||||
Learning rate = 0.1
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.8583333333333333
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.1
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.8722222222222222
|
||||
|
||||
Learning rate = 0.1
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.9055555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.1
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.8805555555555555
|
||||
|
||||
Learning rate = 0.1
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.8722222222222222
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.1
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.8666666666666667
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1.0
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.17777777777777778
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.08333333333333333
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1.0
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.09444444444444444
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 10.0
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.17222222222222222
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.11666666666666667
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.1388888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 10.0
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.11388888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 10.0
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.09444444444444444
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id1">
|
||||
@@ -2418,10 +2110,6 @@ Accuracy score on test set: 0.09444444444444444
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<img alt="_images/chapter10_63_0.png" src="_images/chapter10_63_0.png" />
|
||||
<img alt="_images/chapter10_63_1.png" src="_images/chapter10_63_1.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="building-neural-networks-in-tensorflow-and-keras">
|
||||
@@ -2460,14 +2148,6 @@ and/or if you use <strong>anaconda</strong>, just write (or install from the gra
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span> <span class="n">Input</span> <span class="n">In</span> <span class="p">[</span><span class="mi">12</span><span class="p">]</span>
|
||||
<span class="n">conda</span> <span class="n">create</span> <span class="o">-</span><span class="n">n</span> <span class="n">tf</span> <span class="n">tensorflow</span>
|
||||
<span class="o">^</span>
|
||||
<span class="ne">SyntaxError</span>: invalid syntax
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>To install the current release of GPU TensorFlow</p>
|
||||
<div class="cell docutils container">
|
||||
|
||||
@@ -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">
|
||||
@@ -2652,24 +2662,6 @@ Using TensorFlow results in a much better execution time. Try it!</p>
|
||||
<span class="ne">---> </span><span class="mi">23</span> <span class="n">outgrads</span><span class="p">[</span><span class="n">parent</span><span class="p">]</span> <span class="o">=</span> <span class="n">add_outgrads</span><span class="p">(</span><span class="n">outgrads</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">parent</span><span class="p">),</span> <span class="n">ingrad</span><span class="p">)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">24</span> <span class="k">return</span> <span class="n">outgrad</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
|
||||
<span class="nn">File ~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:165,</span> in <span class="ni">add_outgrads</span><span class="nt">(prev_g_flagged, g)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">163</span> <span class="k">if</span> <span class="n">mutable</span><span class="p">:</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">164</span> <span class="k">if</span> <span class="n">sparse</span><span class="p">:</span>
|
||||
<span class="ne">--> </span><span class="mi">165</span> <span class="k">return</span> <span class="n">sparse_add</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="n">prev_g</span><span class="p">,</span> <span class="n">g</span><span class="p">),</span> <span class="kc">True</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">166</span> <span class="k">else</span><span class="p">:</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">167</span> <span class="k">return</span> <span class="n">vs</span><span class="o">.</span><span class="n">mut_add</span><span class="p">(</span><span class="n">prev_g</span><span class="p">,</span> <span class="n">g</span><span class="p">),</span> <span class="kc">True</span>
|
||||
|
||||
<span class="nn">File ~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/tracer.py:48,</span> in <span class="ni">primitive.<locals>.f_wrapped</span><span class="nt">(*args, **kwargs)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">46</span> <span class="k">return</span> <span class="n">new_box</span><span class="p">(</span><span class="n">ans</span><span class="p">,</span> <span class="n">trace</span><span class="p">,</span> <span class="n">node</span><span class="p">)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">47</span> <span class="k">else</span><span class="p">:</span>
|
||||
<span class="ne">---> </span><span class="mi">48</span> <span class="k">return</span> <span class="n">f_raw</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="nn">File ~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:186,</span> in <span class="ni">sparse_add</span><span class="nt">(vs, x_prev, x_new)</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">183</span> <span class="nd">@primitive</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">184</span> <span class="k">def</span> <span class="nf">sparse_add</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="n">x_prev</span><span class="p">,</span> <span class="n">x_new</span><span class="p">):</span>
|
||||
<span class="g g-Whitespace"> </span><span class="mi">185</span> <span class="n">x_prev</span> <span class="o">=</span> <span class="n">x_prev</span> <span class="k">if</span> <span class="n">x_prev</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">vs</span><span class="o">.</span><span class="n">zeros</span><span class="p">()</span>
|
||||
<span class="ne">--> </span><span class="mi">186</span> <span class="k">return</span> <span class="n">x_new</span><span class="o">.</span><span class="n">mut_add</span><span class="p">(</span><span class="n">x_prev</span><span class="p">)</span>
|
||||
|
||||
<span class="ne">KeyboardInterrupt</span>:
|
||||
</pre></div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
@@ -1297,7 +1307,7 @@ labels = (n_inputs) = (1797,)
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/keras/optimizer_v2/gradient_descent.py:102: UserWarning: The `lr` argument is deprecated, use `learning_rate` instead.
|
||||
super(SGD, self).__init__(name, **kwargs)
|
||||
2023-10-15 21:48:58.909327: W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz
|
||||
2023-10-25 15:31:33.965944: W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
|
||||
|
||||
@@ -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">
|
||||
@@ -700,316 +710,316 @@ systems such as automatic translation and speech-to-text.</p>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 1/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>2023-10-15 21:49:35.228942: W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>2023-10-25 15:32:11.077734: W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 3s - loss: 0.5276 - 3s/epoch - 66ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 3s - loss: 1.4222 - 3s/epoch - 66ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 2/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4234 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.5274 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 3/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4043 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4426 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 4/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4010 - 460ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4375 - 459ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 5/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3979 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4336 - 457ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 6/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3967 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4310 - 461ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 7/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3962 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4287 - 454ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 8/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3957 - 455ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4277 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 9/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3929 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4266 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 10/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3920 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4253 - 457ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 11/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3918 - 454ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4236 - 461ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 12/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3898 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4221 - 459ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 13/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3921 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4208 - 461ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 14/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3911 - 455ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4199 - 462ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 15/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3888 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4203 - 468ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 16/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3871 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4181 - 457ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 17/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3894 - 458ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4177 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 18/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3873 - 455ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4162 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 19/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3855 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4148 - 463ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 20/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3871 - 453ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4146 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 21/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3802 - 455ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4137 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 22/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3856 - 455ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4128 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 23/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3804 - 453ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4130 - 462ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 24/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3842 - 453ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4106 - 457ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 25/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3815 - 452ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4099 - 456ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 26/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3782 - 454ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4100 - 463ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 27/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3798 - 454ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4086 - 456ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 28/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3804 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4088 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 29/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3812 - 452ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4078 - 462ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 30/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3780 - 454ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4063 - 465ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 31/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3800 - 453ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4054 - 455ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 32/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3767 - 467ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4054 - 464ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 33/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3787 - 493ms/epoch - 10ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4048 - 456ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 34/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3758 - 464ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4051 - 454ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 35/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3784 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4027 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 36/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3766 - 461ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4008 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 37/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3733 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4011 - 463ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 38/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3749 - 455ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4024 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 39/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3756 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4014 - 455ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 40/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3737 - 458ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.4001 - 455ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 41/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3743 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3992 - 459ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 42/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3730 - 460ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3990 - 459ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 43/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3706 - 457ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3990 - 459ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 44/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3724 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3975 - 453ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 45/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3716 - 456ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3972 - 457ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 46/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3713 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3948 - 460ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 47/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3705 - 458ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3954 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 48/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3703 - 460ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3931 - 462ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 49/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3701 - 459ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3946 - 461ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 50/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3676 - 470ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3940 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 51/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3679 - 464ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3935 - 457ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 52/100
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3689 - 460ms/epoch - 9ms/step
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>50/50 - 0s - loss: 0.3932 - 458ms/epoch - 9ms/step
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Epoch 53/100
|
||||
|
||||
@@ -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">
|
||||
@@ -1315,10 +1325,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.12765651865754318
|
||||
4.348676117830458
|
||||
[[0.98073929 2.88442538]
|
||||
[2.88442538 9.24128917]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.023888460698069384
|
||||
4.161573669199933
|
||||
[[0.708589 2.01323615]
|
||||
[2.01323615 6.75406265]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1355,10 +1365,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.08652153831327969
|
||||
1.7893215781870513
|
||||
[[1. 0.70344416]
|
||||
[0.70344416 1. ]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.08737007811453563
|
||||
1.792898603630095
|
||||
[[1. 0.65673455]
|
||||
[0.65673455 1. ]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1388,30 +1398,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>[[ 1.71727268 5.22388434]
|
||||
[ 0.31027702 0.17469167]
|
||||
[-0.26149831 -0.93082933]
|
||||
[ 0.04107874 1.47244548]
|
||||
[-2.10812381 -5.28818554]
|
||||
[-1.62910047 -4.07706814]
|
||||
[ 0.92136836 2.27309401]
|
||||
[-0.3175938 -1.42457498]
|
||||
[ 0.68037392 0.16481217]
|
||||
[ 0.64594566 2.41173033]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[ 0.1036544 0.17432695]
|
||||
[ 0.51758232 1.25700419]
|
||||
[-1.37236385 -4.22805937]
|
||||
[-0.46766277 -1.52501047]
|
||||
[ 0.99175336 3.59187177]
|
||||
[-2.34718587 -5.3512747 ]
|
||||
[ 1.94980712 6.99450177]
|
||||
[ 0.24849282 -0.56424167]
|
||||
[-0.35408251 -2.3930301 ]
|
||||
[ 0.73000497 2.04391163]]
|
||||
0 1
|
||||
0 1.717273 5.223884
|
||||
1 0.310277 0.174692
|
||||
2 -0.261498 -0.930829
|
||||
3 0.041079 1.472445
|
||||
4 -2.108124 -5.288186
|
||||
5 -1.629100 -4.077068
|
||||
6 0.921368 2.273094
|
||||
7 -0.317594 -1.424575
|
||||
8 0.680374 0.164812
|
||||
9 0.645946 2.411730
|
||||
0 0.103654 0.174327
|
||||
1 0.517582 1.257004
|
||||
2 -1.372364 -4.228059
|
||||
3 -0.467663 -1.525010
|
||||
4 0.991753 3.591872
|
||||
5 -2.347186 -5.351275
|
||||
6 1.949807 6.994502
|
||||
7 0.248493 -0.564242
|
||||
8 -0.354083 -2.393030
|
||||
9 0.730005 2.043912
|
||||
0 1
|
||||
0 1.000000 0.962653
|
||||
1 0.962653 1.000000
|
||||
0 1.000000 0.966337
|
||||
1 0.966337 1.000000
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1468,37 +1478,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.082246 0.081621 0.082225 0.081617 0.081120 0.073421 0.072973
|
||||
2 0.0 0.081621 0.081679 0.081960 0.081804 0.081742 0.073498 0.073387
|
||||
3 0.0 0.082225 0.081960 0.087271 0.086900 0.086636 0.081057 0.080755
|
||||
4 0.0 0.081617 0.081804 0.086900 0.086868 0.086932 0.080935 0.080903
|
||||
5 0.0 0.081120 0.081742 0.086636 0.086932 0.087311 0.080906 0.081136
|
||||
6 0.0 0.073421 0.073498 0.081057 0.080935 0.080906 0.077455 0.077330
|
||||
7 0.0 0.072973 0.073387 0.080755 0.080903 0.081136 0.077330 0.077429
|
||||
8 0.0 0.072637 0.073376 0.080571 0.080980 0.081466 0.077313 0.077630
|
||||
9 0.0 0.072410 0.073465 0.080502 0.081164 0.081896 0.077403 0.077931
|
||||
10 0.0 0.064640 0.064948 0.073406 0.073471 0.073618 0.071662 0.071685
|
||||
11 0.0 0.064320 0.064896 0.073187 0.073476 0.073840 0.071579 0.071792
|
||||
12 0.0 0.064101 0.064938 0.073080 0.073586 0.074161 0.071601 0.072000
|
||||
13 0.0 0.063980 0.065069 0.073079 0.073797 0.074577 0.071726 0.072305
|
||||
14 0.0 0.063953 0.065289 0.073184 0.074108 0.075089 0.071951 0.072707
|
||||
1 0.0 0.084489 0.079202 0.083269 0.079700 0.076331 0.074355 0.071456
|
||||
2 0.0 0.079202 0.075352 0.079849 0.077042 0.074328 0.072527 0.070086
|
||||
3 0.0 0.083269 0.079849 0.087761 0.084946 0.082203 0.081779 0.079170
|
||||
4 0.0 0.079700 0.077042 0.084946 0.082590 0.080248 0.079820 0.077517
|
||||
5 0.0 0.076331 0.074328 0.082203 0.080248 0.078258 0.077833 0.075804
|
||||
6 0.0 0.074355 0.072527 0.081779 0.079820 0.077833 0.078423 0.076337
|
||||
7 0.0 0.071456 0.070086 0.079170 0.077517 0.075804 0.076337 0.074477
|
||||
8 0.0 0.068743 0.067765 0.076678 0.075294 0.073824 0.074307 0.072650
|
||||
9 0.0 0.066200 0.065559 0.074301 0.073154 0.071901 0.072338 0.070865
|
||||
10 0.0 0.065631 0.064814 0.074306 0.072976 0.071564 0.072718 0.071080
|
||||
11 0.0 0.063225 0.062696 0.071960 0.070845 0.069629 0.070705 0.069239
|
||||
12 0.0 0.060971 0.060691 0.069733 0.068809 0.067769 0.068771 0.067462
|
||||
13 0.0 0.058856 0.058793 0.067619 0.066865 0.065984 0.066919 0.065753
|
||||
14 0.0 0.056870 0.056996 0.065613 0.065012 0.064275 0.065147 0.064113
|
||||
|
||||
8 9 10 11 12 13 14
|
||||
0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
|
||||
1 0.072637 0.072410 0.064640 0.064320 0.064101 0.063980 0.063953
|
||||
2 0.073376 0.073465 0.064948 0.064896 0.064938 0.065069 0.065289
|
||||
3 0.080571 0.080502 0.073406 0.073187 0.073080 0.073079 0.073184
|
||||
4 0.080980 0.081164 0.073471 0.073476 0.073586 0.073797 0.074108
|
||||
5 0.081466 0.081896 0.073618 0.073840 0.074161 0.074577 0.075089
|
||||
6 0.077313 0.077403 0.071662 0.071579 0.071601 0.071726 0.071951
|
||||
7 0.077630 0.077931 0.071685 0.071792 0.072000 0.072305 0.072707
|
||||
8 0.078041 0.078548 0.071805 0.072098 0.072486 0.072967 0.073541
|
||||
9 0.078548 0.079255 0.072022 0.072495 0.073059 0.073712 0.074455
|
||||
10 0.071805 0.072022 0.067420 0.067457 0.067591 0.067820 0.068141
|
||||
11 0.072098 0.072495 0.067457 0.067660 0.067955 0.068340 0.068815
|
||||
12 0.072486 0.073059 0.067591 0.067955 0.068407 0.068945 0.069570
|
||||
13 0.072967 0.073712 0.067820 0.068340 0.068945 0.069634 0.070406
|
||||
14 0.073541 0.074455 0.068141 0.068815 0.069570 0.070406 0.071323
|
||||
1 0.068743 0.066200 0.065631 0.063225 0.060971 0.058856 0.056870
|
||||
2 0.067765 0.065559 0.064814 0.062696 0.060691 0.058793 0.056996
|
||||
3 0.076678 0.074301 0.074306 0.071960 0.069733 0.067619 0.065613
|
||||
4 0.075294 0.073154 0.072976 0.070845 0.068809 0.066865 0.065012
|
||||
5 0.073824 0.071901 0.071564 0.069629 0.067769 0.065984 0.064275
|
||||
6 0.074307 0.072338 0.072718 0.070705 0.068771 0.066919 0.065147
|
||||
7 0.072650 0.070865 0.071080 0.069239 0.067462 0.065753 0.064113
|
||||
8 0.071008 0.069391 0.069456 0.067774 0.066143 0.064568 0.063051
|
||||
9 0.069391 0.067929 0.067859 0.066323 0.064827 0.063378 0.061977
|
||||
10 0.069456 0.067859 0.068437 0.066752 0.065119 0.063542 0.062023
|
||||
11 0.067774 0.066323 0.066752 0.065207 0.063705 0.062250 0.060845
|
||||
12 0.066143 0.064827 0.065119 0.063705 0.062325 0.060983 0.059685
|
||||
13 0.064568 0.063378 0.063542 0.062250 0.060983 0.059749 0.058550
|
||||
14 0.063051 0.061977 0.062023 0.060845 0.059685 0.058550 0.057446
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
@@ -869,10 +879,10 @@ number <span class="math notranslate nohighlight">\(i\)</span> is left out. Usin
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Runtime: 0.136236 sec
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Runtime: 0.134565 sec
|
||||
Jackknife Statistics :
|
||||
original bias std. error
|
||||
99.979 99.969 0.14845
|
||||
100.2 100.19 0.146591
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1091,7 +1101,7 @@ theorem.</p>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Bootstrap Statistics :
|
||||
original bias std. error
|
||||
99.8342 14.8306 99.8351 0.14857
|
||||
99.9919 15.0954 99.9924 0.150989
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1313,14 +1323,14 @@ Error: 0.06844519414009445
|
||||
Bias^2: 0.06453579006728322
|
||||
Var: 0.003909404072811221
|
||||
0.06844519414009445 >= 0.06453579006728322 + 0.003909404072811221 = 0.06844519414009444
|
||||
Polynomial degree: 5
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 5
|
||||
Error: 0.05227921801205679
|
||||
Bias^2: 0.04818727730430286
|
||||
Var: 0.004091940707753925
|
||||
0.05227921801205679 >= 0.04818727730430286 + 0.004091940707753925 = 0.05227921801205679
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 6
|
||||
Polynomial degree: 6
|
||||
Error: 0.03781367141738902
|
||||
Bias^2: 0.03365768507152769
|
||||
Var: 0.0041559863458613296
|
||||
@@ -1640,12 +1650,12 @@ Mean squared error on test data: 1371.99051150
|
||||
Degree of polynomial: 20
|
||||
Mean squared error on training data: 0.00137818
|
||||
Mean squared error on test data: 1887.86252988
|
||||
Degree of polynomial: 21
|
||||
Mean squared error on training data: 0.00118508
|
||||
Mean squared error on test data: 14859.69908626
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 22
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 21
|
||||
Mean squared error on training data: 0.00118508
|
||||
Mean squared error on test data: 14859.69908626
|
||||
Degree of polynomial: 22
|
||||
Mean squared error on training data: 0.00092647
|
||||
Mean squared error on test data: 876.51191552
|
||||
Degree of polynomial: 23
|
||||
@@ -1660,12 +1670,12 @@ Mean squared error on test data: 128664.31650694
|
||||
Degree of polynomial: 26
|
||||
Mean squared error on training data: 0.00076905
|
||||
Mean squared error on test data: 19003.94822514
|
||||
Degree of polynomial: 27
|
||||
Mean squared error on training data: 0.00068946
|
||||
Mean squared error on test data: 2379.66219404
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 28
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 27
|
||||
Mean squared error on training data: 0.00068946
|
||||
Mean squared error on test data: 2379.66219404
|
||||
Degree of polynomial: 28
|
||||
Mean squared error on training data: 0.00062595
|
||||
Mean squared error on test data: 4082.19983530
|
||||
Degree of polynomial: 29
|
||||
@@ -1673,9 +1683,9 @@ Mean squared error on training data: 0.00060705
|
||||
Mean squared error on test data: 3250.17647619
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/626635268.py:73: RuntimeWarning: divide by zero encountered in log10
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/626635268.py:73: RuntimeWarning: divide by zero encountered in log10
|
||||
plt.plot(polynomial, np.log10(trainingerror), label='Training Error')
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/626635268.py:74: RuntimeWarning: divide by zero encountered in log10
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/626635268.py:74: RuntimeWarning: divide by zero encountered in log10
|
||||
plt.plot(polynomial, np.log10(testerror), label='Test Error')
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1909,7 +1919,7 @@ cross-validation (LOOCV).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/3817475779.py:63: RuntimeWarning: divide by zero encountered in log10
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/3817475779.py:63: RuntimeWarning: divide by zero encountered in log10
|
||||
plt.plot(polynomial, np.log10(estimated_mse_sklearn), label='Test Error')
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2798,9 +2808,9 @@ linear system as an equation would reduce this down to
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/4162706317.py:6: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/4162706317.py:6: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
cb = fig.colorbar(im)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/4162706317.py:7: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/4162706317.py:7: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2944,9 +2954,9 @@ with the form utilized in linear regression, viz.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/3777801602.py:6: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/3777801602.py:6: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
cb = fig.colorbar(im)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/3777801602.py:7: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/3777801602.py:7: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2986,9 +2996,9 @@ cost function is given by</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/438060758.py:9: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/438060758.py:9: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
cb = fig.colorbar(im)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/438060758.py:10: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/438060758.py:10: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3023,9 +3033,9 @@ cost function is given by</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/3544313922.py:8: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/3544313922.py:8: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
cb = fig.colorbar(im)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/3544313922.py:9: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/3544313922.py:9: UserWarning: FixedFormatter should only be used together with FixedLocator
|
||||
cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3078,43 +3088,43 @@ constant as opposed to ridge and OLS. We get a sparse solution with
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 0%| | 0/10 [00:00<?, ?it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 0%| | 0/10 [00:00<?, ?it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:647: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 3.924e+00, tolerance: 1.797e+00
|
||||
model = cd_fast.enet_coordinate_descent(
|
||||
|
||||
10%|███████████▍ | 1/10 [00:00<00:08, 1.06it/s]
|
||||
10%|██████████████▌ | 1/10 [00:01<00:09, 1.07s/it]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 20%|██████████████████████▊ | 2/10 [00:01<00:07, 1.04it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 20%|█████████████████████████████ | 2/10 [00:02<00:08, 1.09s/it]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 30%|██████████████████████████████████▏ | 3/10 [00:02<00:05, 1.25it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 30%|███████████████████████████████████████████▌ | 3/10 [00:02<00:06, 1.07it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 40%|█████████████████████████████████████████████▌ | 4/10 [00:03<00:04, 1.36it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 40%|██████████████████████████████████████████████████████████ | 4/10 [00:03<00:05, 1.19it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 50%|█████████████████████████████████████████████████████████ | 5/10 [00:03<00:03, 1.43it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 50%|████████████████████████████████████████████████████████████████████████▌ | 5/10 [00:04<00:03, 1.26it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 60%|████████████████████████████████████████████████████████████████████▍ | 6/10 [00:04<00:02, 1.50it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 60%|███████████████████████████████████████████████████████████████████████████████████████ | 6/10 [00:05<00:03, 1.33it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 70%|███████████████████████████████████████████████████████████████████████████████▊ | 7/10 [00:05<00:01, 1.55it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 70%|█████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 7/10 [00:05<00:02, 1.35it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 80%|███████████████████████████████████████████████████████████████████████████████████████████▏ | 8/10 [00:05<00:01, 1.60it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 80%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 8/10 [00:06<00:01, 1.40it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 90%|██████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 9/10 [00:06<00:00, 1.61it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 90%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 9/10 [00:07<00:00, 1.42it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:06<00:00, 1.62it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:07<00:00, 1.44it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:06<00:00, 1.47it/s]
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:07<00:00, 1.29it/s]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>
|
||||
@@ -3261,9 +3271,9 @@ which polynomial fits the data best.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/3980313467.py:9: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/3980313467.py:9: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
ax = fig.gca(projection='3d')
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31624/3980313467.py:37: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10962/3980313467.py:37: MatplotlibDeprecationWarning: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
|
||||
fig.colorbar(surf, shrink=0.5, aspect=5)
|
||||
</pre></div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
@@ -797,9 +807,9 @@ predicting the target features of query instances is as follows:</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>2nd degree coefficients:
|
||||
zero power: -0.2774877574815404
|
||||
first power: 0.11112589053037751
|
||||
second power: -0.00033136014047192484
|
||||
zero power: 2.731441119315968
|
||||
first power: -0.07208896238192342
|
||||
second power: 0.0005051756404139333
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapter6_1_1.png" src="_images/chapter6_1_1.png" />
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
@@ -1047,11 +1057,11 @@ which equals</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31672/483257001.py:18: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11016/483257001.py:18: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
ax = fig.gca(projection="3d")
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><mpl_toolkits.mplot3d.art3d.Poly3DCollection at 0x1183f2640>
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><mpl_toolkits.mplot3d.art3d.Poly3DCollection at 0x122d2e790>
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapteroptimization_61_2.png" src="_images/chapteroptimization_61_2.png" />
|
||||
@@ -1109,7 +1119,7 @@ which equals</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[<matplotlib.lines.Line2D at 0x118c9b1c0>]
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[<matplotlib.lines.Line2D at 0x12334c310>]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapteroptimization_69_1.png" src="_images/chapteroptimization_69_1.png" />
|
||||
@@ -1366,11 +1376,11 @@ when <span class="math notranslate nohighlight">\(||\nabla_\beta C(\beta_k) || \
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.29633889 4.15119514]
|
||||
[[3.90793019]
|
||||
[3.18761375]]
|
||||
[[3.90793019]
|
||||
[3.18761375]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.27637358 4.69167569]
|
||||
[[4.08692465]
|
||||
[2.84462849]]
|
||||
[[4.08692465]
|
||||
[2.84462849]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapteroptimization_123_1.png" src="_images/chapteroptimization_123_1.png" />
|
||||
@@ -1399,9 +1409,9 @@ when <span class="math notranslate nohighlight">\(||\nabla_\beta C(\beta_k) || \
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[3.96783837]
|
||||
[3.23305112]]
|
||||
[3.95982273] [3.21682143]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[4.17086577]
|
||||
[2.92317667]]
|
||||
[4.14538257] [2.90670236]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1472,10 +1482,10 @@ C_{\text{ridge}}(\beta) = \frac{1}{n}||X\beta -\mathbf{y}||^2 + \lambda ||\beta|
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[3.91619855]
|
||||
[3.20101684]]
|
||||
[[3.85813693]
|
||||
[3.24679418]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[4.11027723]
|
||||
[2.92805329]]
|
||||
[[4.04931542]
|
||||
[2.97504526]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapteroptimization_132_1.png" src="_images/chapteroptimization_132_1.png" />
|
||||
@@ -1725,15 +1735,15 @@ function.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[3.70224083]
|
||||
[3.16389131]]
|
||||
Eigenvalues of Hessian Matrix:[0.29022057 4.66510547]
|
||||
[[3.22532324]
|
||||
[3.44210664]]
|
||||
Eigenvalues of Hessian Matrix:[0.30012384 4.62464344]
|
||||
theta from own gd
|
||||
[[3.70224083]
|
||||
[3.16389131]]
|
||||
[[3.22532324]
|
||||
[3.44210664]]
|
||||
theta from own sdg
|
||||
[[3.67541155]
|
||||
[3.1532465 ]]
|
||||
[[3.17736035]
|
||||
[3.48289037]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/chapteroptimization_148_1.png" src="_images/chapteroptimization_148_1.png" />
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -331,6 +331,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">
|
||||
|
||||
@@ -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">
|
||||
@@ -804,15 +814,15 @@ regression.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[3.89481038]
|
||||
[3.13155259]]
|
||||
Eigenvalues of Hessian Matrix:[0.28194659 4.81122914]
|
||||
[[3.97739698]
|
||||
[2.9189726 ]]
|
||||
Eigenvalues of Hessian Matrix:[0.27987128 4.51549827]
|
||||
theta from own gd
|
||||
[[3.89481038]
|
||||
[3.13155259]]
|
||||
[[3.97739698]
|
||||
[2.9189726 ]]
|
||||
theta from own sdg
|
||||
[[3.88291866]
|
||||
[3.19123037]]
|
||||
[[3.9577228 ]
|
||||
[2.91473433]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/exercisesweek41_5_1.png" src="_images/exercisesweek41_5_1.png" />
|
||||
@@ -934,14 +944,14 @@ first example shows results with ordinary leats squares.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[4.23636536]
|
||||
[2.77184871]]
|
||||
Eigenvalues of Hessian Matrix:[0.30125775 4.66878535]
|
||||
[[4.32133765]
|
||||
[2.59905073]]
|
||||
Eigenvalues of Hessian Matrix:[0.29426584 4.28858038]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>theta from own gd
|
||||
[[4.23636536]
|
||||
[2.77184871]]
|
||||
[[4.32133765]
|
||||
[2.59905073]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/exercisesweek41_16_2.png" src="_images/exercisesweek41_16_2.png" />
|
||||
@@ -1012,73 +1022,73 @@ Eigenvalues of Hessian Matrix:[0.30125775 4.66878535]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[4.]
|
||||
[3.]]
|
||||
Eigenvalues of Hessian Matrix:[0.35058127 4.29679459]
|
||||
0 [-8.31895514] [-8.15055258]
|
||||
1 [-0.75472506] [0.63957747]
|
||||
2 [-0.69314603] [0.58739348]
|
||||
3 [-0.63659131] [0.53946725]
|
||||
4 [-0.58465096] [0.49545139]
|
||||
5 [-0.5369485] [0.45502684]
|
||||
6 [-0.49313815] [0.41790059]
|
||||
7 [-0.45290234] [0.38380352]
|
||||
8 [-0.41594943] [0.35248847]
|
||||
9 [-0.38201155] [0.32372846]
|
||||
10 [-0.35084272] [0.29731502]
|
||||
11 [-0.32221699] [0.27305669]
|
||||
12 [-0.29592687] [0.25077762]
|
||||
13 [-0.2717818] [0.23031634]
|
||||
14 [-0.24960675] [0.21152452]
|
||||
15 [-0.229241] [0.19426595]
|
||||
16 [-0.21053692] [0.17841553]
|
||||
17 [-0.19335893] [0.16385836]
|
||||
18 [-0.17758251] [0.15048894]
|
||||
19 [-0.16309331] [0.13821034]
|
||||
20 [-0.14978631] [0.12693357]
|
||||
21 [-0.13756504] [0.11657689]
|
||||
22 [-0.12634093] [0.10706523]
|
||||
23 [-0.1160326] [0.09832963]
|
||||
24 [-0.10656534] [0.09030678]
|
||||
25 [-0.09787053] [0.08293853]
|
||||
26 [-0.08988514] [0.07617146]
|
||||
27 [-0.08255129] [0.06995653]
|
||||
28 [-0.07581582] [0.06424868]
|
||||
29 [-0.06962991] [0.05900655]
|
||||
Eigenvalues of Hessian Matrix:[0.30311767 4.03556032]
|
||||
0 [-14.28624958] [-15.54071847]
|
||||
1 [-0.04900086] [0.04473913]
|
||||
2 [-0.04532032] [0.0413787]
|
||||
3 [-0.04191624] [0.03827068]
|
||||
4 [-0.03876784] [0.0353961]
|
||||
5 [-0.03585592] [0.03273744]
|
||||
6 [-0.03316272] [0.03027848]
|
||||
7 [-0.03067182] [0.02800421]
|
||||
8 [-0.02836801] [0.02590077]
|
||||
9 [-0.02623724] [0.02395532]
|
||||
10 [-0.02426651] [0.022156]
|
||||
11 [-0.02244382] [0.02049182]
|
||||
12 [-0.02075802] [0.01895265]
|
||||
13 [-0.01919885] [0.01752908]
|
||||
14 [-0.0177568] [0.01621244]
|
||||
15 [-0.01642305] [0.0149947]
|
||||
16 [-0.01518949] [0.01386842]
|
||||
17 [-0.01404858] [0.01282674]
|
||||
18 [-0.01299337] [0.0118633]
|
||||
19 [-0.01201742] [0.01097223]
|
||||
20 [-0.01111477] [0.01014809]
|
||||
21 [-0.01027992] [0.00938585]
|
||||
22 [-0.00950778] [0.00868086]
|
||||
23 [-0.00879363] [0.00802883]
|
||||
24 [-0.00813313] [0.00742577]
|
||||
25 [-0.00752224] [0.00686801]
|
||||
26 [-0.00695723] [0.00635214]
|
||||
27 [-0.00643466] [0.00587502]
|
||||
28 [-0.00595134] [0.00543374]
|
||||
29 [-0.00550433] [0.0050256]
|
||||
theta from own gd
|
||||
[[3.81759234]
|
||||
[3.15457792]]
|
||||
0 [-0.06394871] [0.05419212]
|
||||
1 [-0.05873105] [0.04977051]
|
||||
2 [-0.0523738] [0.04438319]
|
||||
3 [-0.04619338] [0.03914571]
|
||||
4 [-0.04057027] [0.03438051]
|
||||
5 [-0.03557316] [0.0301458]
|
||||
6 [-0.03117156] [0.02641575]
|
||||
7 [-0.02730775] [0.02314144]
|
||||
8 [-0.02392053] [0.020271]
|
||||
9 [-0.02095266] [0.01775594]
|
||||
10 [-0.01835274] [0.01555268]
|
||||
11 [-0.01607534] [0.01362274]
|
||||
12 [-0.01408051] [0.01193226]
|
||||
13 [-0.01233322] [0.01045155]
|
||||
14 [-0.01080274] [0.00915458]
|
||||
15 [-0.00946219] [0.00801855]
|
||||
16 [-0.00828799] [0.0070235]
|
||||
17 [-0.0072595] [0.00615193]
|
||||
18 [-0.00635865] [0.00538851]
|
||||
19 [-0.00556958] [0.00471983]
|
||||
20 [-0.00487843] [0.00413413]
|
||||
21 [-0.00427304] [0.00362111]
|
||||
22 [-0.00374279] [0.00317175]
|
||||
23 [-0.00327833] [0.00277816]
|
||||
24 [-0.00287151] [0.00243341]
|
||||
25 [-0.00251517] [0.00213144]
|
||||
26 [-0.00220306] [0.00186694]
|
||||
27 [-0.00192967] [0.00163526]
|
||||
28 [-0.00169021] [0.00143234]
|
||||
29 [-0.00148047] [0.00125459]
|
||||
[[3.98320492]
|
||||
[3.01533437]]
|
||||
0 [-0.00509089] [0.00464812]
|
||||
1 [-0.0047085] [0.00429899]
|
||||
2 [-0.00424012] [0.00387135]
|
||||
3 [-0.00378113] [0.00345227]
|
||||
4 [-0.00335942] [0.00306724]
|
||||
5 [-0.00298058] [0.00272135]
|
||||
6 [-0.00264305] [0.00241318]
|
||||
7 [-0.00234327] [0.00213947]
|
||||
8 [-0.00207732] [0.00189665]
|
||||
9 [-0.00184151] [0.00168135]
|
||||
10 [-0.00163245] [0.00149047]
|
||||
11 [-0.00144711] [0.00132125]
|
||||
12 [-0.00128282] [0.00117125]
|
||||
13 [-0.00113717] [0.00103827]
|
||||
14 [-0.00100807] [0.00092039]
|
||||
15 [-0.00089362] [0.0008159]
|
||||
16 [-0.00079216] [0.00072326]
|
||||
17 [-0.00070222] [0.00064115]
|
||||
18 [-0.0006225] [0.00056836]
|
||||
19 [-0.00055182] [0.00050383]
|
||||
20 [-0.00048917] [0.00044663]
|
||||
21 [-0.00043363] [0.00039592]
|
||||
22 [-0.0003844] [0.00035097]
|
||||
23 [-0.00034076] [0.00031112]
|
||||
24 [-0.00030207] [0.0002758]
|
||||
25 [-0.00026778] [0.00024449]
|
||||
26 [-0.00023737] [0.00021673]
|
||||
27 [-0.00021042] [0.00019212]
|
||||
28 [-0.00018653] [0.00017031]
|
||||
29 [-0.00016536] [0.00015097]
|
||||
theta from own gd wth momentum
|
||||
[[3.99630114]
|
||||
[3.00313452]]
|
||||
[[3.99951642]
|
||||
[3.00044152]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1131,17 +1141,17 @@ theta from own gd wth momentum
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[4.08185019]
|
||||
[2.82781715]]
|
||||
Eigenvalues of Hessian Matrix:[0.32244056 3.90871918]
|
||||
0 [-14.19393543] [-14.29174301]
|
||||
1 [-6.35255737e-15] [-1.10851799e-14]
|
||||
2 [-5.89805982e-17] [-2.66490332e-16]
|
||||
3 [9.81853487e-16] [1.10741066e-15]
|
||||
4 [-5.89805982e-17] [-2.66490332e-16]
|
||||
[[3.66959644]
|
||||
[3.26513904]]
|
||||
Eigenvalues of Hessian Matrix:[0.33285444 4.11450263]
|
||||
0 [-12.48534921] [-14.7906583]
|
||||
1 [-1.09712586e-14] [-5.19623863e-15]
|
||||
2 [-1.27068495e-16] [-2.9424428e-16]
|
||||
3 [5.91540705e-16] [7.2837521e-16]
|
||||
4 [-1.27068495e-16] [-2.9424428e-16]
|
||||
beta from own Newton code
|
||||
[[4.08185019]
|
||||
[2.82781715]]
|
||||
[[3.66959644]
|
||||
[3.26513904]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1230,20 +1240,18 @@ beta from own Newton code
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[3.41716708]
|
||||
[3.50046106]]
|
||||
Eigenvalues of Hessian Matrix:[0.24252405 4.30774404]
|
||||
[[3.68184997]
|
||||
[3.32507975]]
|
||||
Eigenvalues of Hessian Matrix:[0.26370919 4.62518501]
|
||||
theta from own gd
|
||||
[[3.68184997]
|
||||
[3.32507975]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>theta from own gd
|
||||
[[3.41716708]
|
||||
[3.50046106]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/exercisesweek41_22_2.png" src="_images/exercisesweek41_22_2.png" />
|
||||
<img alt="_images/exercisesweek41_22_1.png" src="_images/exercisesweek41_22_1.png" />
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>theta from own sdg
|
||||
[[3.38135654]
|
||||
[3.49216685]]
|
||||
[[3.68809785]
|
||||
[3.32032017]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1325,15 +1333,15 @@ Eigenvalues of Hessian Matrix:[0.24252405 4.30774404]
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[4.12427537]
|
||||
[2.85355539]]
|
||||
Eigenvalues of Hessian Matrix:[0.33486875 3.91080327]
|
||||
[[3.55555773]
|
||||
[3.41891092]]
|
||||
Eigenvalues of Hessian Matrix:[0.30326262 4.34133193]
|
||||
theta from own gd
|
||||
[[4.12417157]
|
||||
[2.85365229]]
|
||||
[[3.55511609]
|
||||
[3.41928689]]
|
||||
theta from own sdg with momentum
|
||||
[[4.25050227]
|
||||
[2.8249367 ]]
|
||||
[[3.58207928]
|
||||
[3.37895549]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1408,9 +1416,9 @@ theta from own sdg with momentum
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>theta from own AdaGrad
|
||||
[[1.99999773]
|
||||
[3.0000164 ]
|
||||
[3.99998703]]
|
||||
[[2.00039962]
|
||||
[2.99772199]
|
||||
[4.00233436]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1492,9 +1500,9 @@ theta from own sdg with momentum
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>theta from own RMSprop
|
||||
[[2.01023308]
|
||||
[2.95235306]
|
||||
[4.04597076]]
|
||||
[[1.99858411]
|
||||
[2.9981377 ]
|
||||
[3.99861427]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1580,9 +1588,9 @@ theta from own sdg with momentum
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>theta from own ADAM
|
||||
[[1.99998193]
|
||||
[3.0000747 ]
|
||||
[3.99992263]]
|
||||
[[2.00002678]
|
||||
[2.99985103]
|
||||
[4.00014662]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1655,7 +1663,7 @@ It provides composable transformations of Python+NumPy programs: differentiate,
|
||||
return asarray(x, dtype=self.dtype)
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[<matplotlib.lines.Line2D at 0x10febc640>]
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[<matplotlib.lines.Line2D at 0x1262b9a90>]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/exercisesweek41_39_2.png" src="_images/exercisesweek41_39_2.png" />
|
||||
@@ -1694,7 +1702,7 @@ It provides composable transformations of Python+NumPy programs: differentiate,
|
||||
return asarray(x, dtype=self.dtype)
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><matplotlib.collections.PathCollection at 0x10febcf10>
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><matplotlib.collections.PathCollection at 0x126323b50>
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/exercisesweek41_41_2.png" src="_images/exercisesweek41_41_2.png" />
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -933,8 +933,9 @@ Accuracy score on data set: 0.5
|
||||
Learning rate = 0.0001
|
||||
Lambda = 0.0001
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
Learning rate = 0.0001
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 0.001
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
@@ -1117,7 +1118,7 @@ Accuracy score on data set: 0.5
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/exercisesweek43_26_2.png" src="_images/exercisesweek43_26_2.png" />
|
||||
<img alt="_images/exercisesweek43_26_3.png" src="_images/exercisesweek43_26_3.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
@@ -653,8 +663,9 @@ matrices and vectors.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[-1.0526992 -0.18065292 0.78521833 0.80074264 0.59327016 -1.16492688
|
||||
0.85276246 -0.04581197 -0.65825344 -0.87931006]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[-8.18243276e-01 -1.33525471e+00 -8.98409646e-01 -7.24434901e-01
|
||||
2.27832584e+00 -8.78192446e-01 -1.35539164e-03 -7.36097055e-01
|
||||
-1.06125720e+00 2.86376300e+00]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -875,26 +886,36 @@ as (recall that we user lowercase letters for vectors and uppercase letters for
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0.80207897 0.22885848 0.14526269 0.91022359 0.76135601 0.52687741
|
||||
0.68711054 0.01455922 0.70967214 0.47297104]
|
||||
[0.87431418 0.15724663 0.06301519 0.41894238 0.47364408 0.06406913
|
||||
0.31588043 0.87953769 0.74731872 0.10490195]
|
||||
[0.87533326 0.71038664 0.29726695 0.34011629 0.51741855 0.32185967
|
||||
0.58793527 0.0510594 0.81948868 0.5914397 ]
|
||||
[0.96850702 0.53558374 0.40512793 0.83443463 0.96618584 0.54644868
|
||||
0.1871257 0.28585116 0.79035184 0.2171263 ]
|
||||
[0.46873567 0.91358019 0.28294305 0.03061555 0.86850963 0.19910208
|
||||
0.16650509 0.07417526 0.42535003 0.98765625]
|
||||
[0.29588674 0.70249832 0.5364857 0.1036131 0.56249706 0.15827078
|
||||
0.53515878 0.40182469 0.24828523 0.44402322]
|
||||
[0.95746721 0.33159476 0.86811569 0.89098129 0.67109613 0.96599594
|
||||
0.17078905 0.22297358 0.2193546 0.4993133 ]
|
||||
[0.60675691 0.33800793 0.23780865 0.30914432 0.64695862 0.19717411
|
||||
0.94400087 0.07404236 0.20967833 0.74391438]
|
||||
[0.72651548 0.13310008 0.78220032 0.90556496 0.45014 0.19314584
|
||||
0.71977472 0.97866042 0.53700083 0.10479359]
|
||||
[0.17829104 0.30129931 0.77203046 0.2707158 0.09391542 0.82988221
|
||||
0.61480907 0.29282684 0.37667238 0.91086026]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[3.88960586e-01 2.54050804e-02 9.61246573e-01 4.42642980e-01
|
||||
4.99344165e-01 8.87477172e-01 2.94785447e-01 4.80006130e-01
|
||||
8.05206787e-02 9.27743488e-01]
|
||||
[9.00892604e-01 5.95597666e-01 5.92327822e-01 4.71979573e-01
|
||||
2.92123586e-01 1.36128659e-01 7.83917436e-01 1.19154013e-01
|
||||
7.92576742e-01 6.87338811e-01]
|
||||
[5.40660618e-01 1.11628185e-01 9.46904874e-01 7.61050884e-01
|
||||
5.94782102e-01 6.61949985e-03 3.01329488e-01 4.26660718e-01
|
||||
2.07824586e-02 5.75821358e-01]
|
||||
[7.16539406e-01 8.20261698e-01 5.70328587e-01 5.03331552e-01
|
||||
9.26331821e-01 6.78989003e-01 9.53683592e-01 1.41471556e-01
|
||||
3.17934657e-01 2.93828592e-01]
|
||||
[1.22354860e-01 4.77805840e-01 9.56878976e-01 2.21706540e-01
|
||||
8.57223110e-01 2.55043852e-01 7.60863613e-01 4.61669885e-01
|
||||
5.31290061e-01 7.60381656e-01]
|
||||
[1.68685905e-01 1.26113838e-01 8.15301931e-01 4.38511237e-01
|
||||
4.42633236e-01 7.28595266e-01 3.30571694e-01 3.15593134e-01
|
||||
8.22979294e-01 7.32441343e-01]
|
||||
[5.43608740e-01 2.76181397e-01 6.66722647e-01 7.35434042e-01
|
||||
2.44020145e-01 2.15352815e-01 1.91487049e-01 6.11137061e-01
|
||||
2.79167312e-01 2.27230624e-01]
|
||||
[8.97033646e-02 1.88667234e-01 1.80076024e-01 8.65728698e-01
|
||||
2.79254918e-01 3.33457718e-01 9.52626194e-01 8.75240336e-01
|
||||
7.76059447e-01 3.52565509e-01]
|
||||
[8.49556373e-03 1.50925722e-04 8.98413020e-01 7.49186362e-01
|
||||
1.90602444e-01 4.79877535e-01 6.10615323e-01 7.78031111e-02
|
||||
2.39856058e-01 3.20554718e-01]
|
||||
[2.63843494e-01 1.46306318e-01 7.29933720e-01 5.27826845e-01
|
||||
1.33857909e-01 3.50359169e-01 4.20020918e-01 8.58581665e-03
|
||||
5.54378734e-02 8.68351374e-01]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -954,13 +975,13 @@ 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.016972818397989375
|
||||
3.9050595316983907
|
||||
0.11007935789924998
|
||||
[[ 1.21860973 3.69519297 6.31082439]
|
||||
[ 3.69519297 12.18993003 19.00431775]
|
||||
[ 6.31082439 19.00431775 65.3283771 ]]
|
||||
[72.14421971 0.08339896 6.5092982 ]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.07291818479810824
|
||||
4.313183599076104
|
||||
-0.05687021620384533
|
||||
[[ 0.87810129 2.59703606 2.52470105]
|
||||
[ 2.59703606 8.59883217 6.83603568]
|
||||
[ 2.52470105 6.83603568 13.87354403]]
|
||||
[19.25091007 0.06413187 4.03543554]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +56,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Project 2 on Machine Learning, deadline November 13 (Midnight)" href="project2.html" />
|
||||
<link rel="prev" title="Week 42 Constructing a Neural Network code with introduction to Tensor flow" href="week42.html" />
|
||||
<link rel="prev" title="Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations" href="week43.html" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="None">
|
||||
|
||||
@@ -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">
|
||||
@@ -700,7 +710,7 @@ which polynomial fits the data best.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31707/39730396.py:11: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11057/39730396.py:11: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
ax = fig.gca(projection='3d')
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -1059,11 +1069,11 @@ of code developers and contributors keeps increasing.</p>
|
||||
|
||||
<!-- Previous / next buttons -->
|
||||
<div class='prev-next-area'>
|
||||
<a class='left-prev' id="prev-link" href="week42.html" title="previous page">
|
||||
<a class='left-prev' id="prev-link" href="week43.html" title="previous page">
|
||||
<i class="fas fa-angle-left"></i>
|
||||
<div class="prev-next-info">
|
||||
<p class="prev-next-subtitle">previous</p>
|
||||
<p class="prev-next-title">Week 42 Constructing a Neural Network code with introduction to Tensor flow</p>
|
||||
<p class="prev-next-title">Week 43: Deep Learning: Constructing a Neural Network code and solving differential equations</p>
|
||||
</div>
|
||||
</a>
|
||||
<a class='right-next' id="next-link" href="project2.html" title="next page">
|
||||
|
||||
@@ -332,6 +332,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">
|
||||
|
||||
@@ -331,6 +331,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">
|
||||
|
||||
@@ -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">
|
||||
@@ -1025,27 +1035,27 @@ uncorrelated.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>1.3329671101137754
|
||||
[[ 5.35146218 5.08271388 8.11911824 8.05880359 2.9797317 2.96911909
|
||||
7.59642735 1.24785221 3.14389839 8.36403046]
|
||||
[ 5.08271388 4.827462 7.71137935 7.65409368 2.83009076 2.82001111
|
||||
7.21493779 1.18518557 2.98601306 7.94399217]
|
||||
[ 8.11911824 7.71137935 12.31814386 12.22663583 4.52078202 4.5046808
|
||||
11.52512898 1.89321335 4.76985203 12.68971917]
|
||||
[ 8.05880359 7.65409368 12.22663583 12.13580759 4.4871984 4.4712168
|
||||
11.43951204 1.8791492 4.73441814 12.59545081]
|
||||
[ 2.9797317 2.83009076 4.52078202 4.4871984 1.65913552 1.65322635
|
||||
4.22974406 0.69481287 1.75054469 4.65715086]
|
||||
[ 2.96911909 2.82001111 4.5046808 4.4712168 1.65322635 1.64733822
|
||||
4.21467941 0.69233822 1.74430995 4.64056395]
|
||||
[ 7.59642735 7.21493779 11.52512898 11.43951204 4.22974406 4.21467941
|
||||
10.78316665 1.77133246 4.4627795 11.8727831 ]
|
||||
[ 1.24785221 1.18518557 1.89321335 1.8791492 0.69481287 0.69233822
|
||||
1.77133246 0.29097377 0.7330932 1.9503219 ]
|
||||
[ 3.14389839 2.98601306 4.76985203 4.73441814 1.75054469 1.74430995
|
||||
4.4627795 0.7330932 1.84698999 4.91373404]
|
||||
[ 8.36403046 7.94399217 12.68971917 12.59545081 4.65715086 4.64056395
|
||||
11.8727831 1.9503219 4.91373404 13.07250301]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>2.0994119523801045
|
||||
[[12.84061976 8.96489054 20.01094579 11.7317759 10.16168848 9.47128712
|
||||
5.28962017 13.19870992 12.47831084 19.16089488]
|
||||
[ 8.96489054 6.25898624 13.97097196 8.19073291 7.09455047 6.61253537
|
||||
3.69303559 9.21489709 8.71193859 13.37749489]
|
||||
[20.01094579 13.97097196 31.18525109 18.28291282 15.83607342 14.76014528
|
||||
8.24339513 20.56899695 19.44632008 29.86052354]
|
||||
[11.7317759 8.19073291 18.28291282 10.71868557 9.28418209 8.65339992
|
||||
4.83283826 12.0589434 11.40075395 17.50626752]
|
||||
[10.16168848 7.09455047 15.83607342 9.28418209 8.04166112 7.49529781
|
||||
4.18604968 10.44507049 9.87496787 15.16336815]
|
||||
[ 9.47128712 6.61253537 14.76014528 8.65339992 7.49529781 6.9860553
|
||||
3.90164278 9.7354157 9.20404676 14.13314468]
|
||||
[ 5.28962017 3.69303559 8.24339513 4.83283826 4.18604968 3.90164278
|
||||
2.1790289 5.43713337 5.14036907 7.8932215 ]
|
||||
[13.19870992 9.21489709 20.56899695 12.0589434 10.44507049 9.7354157
|
||||
5.43713337 13.56678624 12.82629718 19.69524041]
|
||||
[12.47831084 8.71193859 19.44632008 11.40075395 9.87496787 9.20404676
|
||||
5.14036907 12.82629718 12.12622478 18.62025406]
|
||||
[19.16089488 13.37749489 29.86052354 17.50626752 15.16336815 14.13314468
|
||||
7.8932215 19.69524041 18.62025406 28.59206948]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1313,15 +1323,15 @@ more practically oriented methods like the blocking technique.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.02582613386840159
|
||||
3.8311393813043355
|
||||
-0.30339081517583943
|
||||
1.1608179281668718 12.374777250972322 24.97606135399951
|
||||
3.6353716266230895 4.038211969489939 12.83140314044099
|
||||
[[ 1.16081793 3.63537163 4.03821197]
|
||||
[ 3.63537163 12.37477725 12.83140314]
|
||||
[ 4.03821197 12.83140314 24.97606135]]
|
||||
[33.84671508 0.08066381 4.58427764]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.035513525941656535
|
||||
4.0516821246279795
|
||||
-0.00822879725131466
|
||||
1.0340060287164625 10.447659635275407 10.449001126081919
|
||||
3.1285896350792584 2.5721905504656455 7.8028954343792245
|
||||
[[ 1.03400603 3.12858964 2.57219055]
|
||||
[ 3.12858964 10.44765964 7.80289543]
|
||||
[ 2.57219055 7.80289543 10.44900113]]
|
||||
[19.14871402 0.07942491 2.70252786]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1651,7 +1661,7 @@ assumption for approximating <span class="math notranslate nohighlight">\(\sigma
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.01229732982000352 0.93003138502386
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.024318244280276506 1.0399587275832265
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/statistics_188_1.png" src="_images/statistics_188_1.png" />
|
||||
|
||||
@@ -331,6 +331,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">
|
||||
|
||||
@@ -331,6 +331,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">
|
||||
|
||||
@@ -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">
|
||||
@@ -1815,8 +1825,8 @@ developed in the 1970s, namely EISPACK and LINPACK. We describe them shortly he
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 0.27919014 -0.36550376 -0.86282204 1.31714002 -1.99484719 -0.63837812
|
||||
1.45062284 -0.33079132 -0.58182803 -0.7207467 ]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 0.98502634 -1.56822376 -0.45668633 1.26063304 -1.43801947 -0.72264336
|
||||
0.12428533 -0.64472123 -0.99439119 0.84257054]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2041,26 +2051,26 @@ lowercase letters for vectors and uppercase letters for matrices)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0.23516186 0.40009482 0.40666305 0.26318493 0.37335014 0.7865355
|
||||
0.11587186 0.81840893 0.38046294 0.17138811]
|
||||
[0.70506522 0.56475572 0.02507163 0.57935482 0.33537181 0.32382849
|
||||
0.37266855 0.00348543 0.11400145 0.84991754]
|
||||
[0.27152452 0.88901776 0.95166414 0.82292185 0.09524714 0.92630576
|
||||
0.29374695 0.55867377 0.10959669 0.71647328]
|
||||
[0.15913825 0.89604286 0.80447153 0.59412285 0.30990916 0.94642209
|
||||
0.20494446 0.7215423 0.03049638 0.55649207]
|
||||
[0.70899024 0.80389541 0.60883945 0.7803213 0.43466245 0.33078483
|
||||
0.86852099 0.19772911 0.93022647 0.45253585]
|
||||
[0.5810785 0.94823368 0.73379189 0.09408163 0.14549142 0.8353591
|
||||
0.46754435 0.29732036 0.7698352 0.39200159]
|
||||
[0.77265782 0.37376184 0.43647835 0.38782352 0.97449977 0.02276062
|
||||
0.36802977 0.43941514 0.99006712 0.98316168]
|
||||
[0.89897156 0.04956816 0.52067151 0.52180619 0.21275991 0.86420934
|
||||
0.50653545 0.49057373 0.77067609 0.16043757]
|
||||
[0.22616902 0.70408916 0.43902948 0.68992377 0.5608253 0.84132082
|
||||
0.95661705 0.7082333 0.33600213 0.44116407]
|
||||
[0.96459246 0.32141575 0.95679388 0.44595818 0.1875353 0.47700752
|
||||
0.03321947 0.55865092 0.96543101 0.63227278]]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0.36681298 0.62199022 0.32023229 0.08231145 0.09917246 0.29025302
|
||||
0.85115237 0.79516409 0.833774 0.85910255]
|
||||
[0.08990571 0.56425249 0.34440086 0.37540613 0.30085673 0.93901621
|
||||
0.00790262 0.92604308 0.7742213 0.58486384]
|
||||
[0.57811941 0.84268865 0.11339075 0.57329374 0.78094722 0.46156624
|
||||
0.2545724 0.1095957 0.6559956 0.22291364]
|
||||
[0.12049203 0.50172141 0.38493367 0.62633359 0.13880371 0.37092452
|
||||
0.21913628 0.78478186 0.12625715 0.89142357]
|
||||
[0.69018454 0.02200532 0.63281889 0.28622606 0.84900747 0.44440345
|
||||
0.5302517 0.15957051 0.10154612 0.7025846 ]
|
||||
[0.26518597 0.48577692 0.68736603 0.10401756 0.88473534 0.31949465
|
||||
0.00434364 0.20240089 0.46285399 0.64432571]
|
||||
[0.39229856 0.66289428 0.2591811 0.68871199 0.37021881 0.32041353
|
||||
0.93049763 0.30690504 0.63212587 0.56397327]
|
||||
[0.31212802 0.82402448 0.94610136 0.19407473 0.28535441 0.99933329
|
||||
0.55331574 0.96439516 0.4809676 0.21947455]
|
||||
[0.66489687 0.7613959 0.33285905 0.20726939 0.74587018 0.97375628
|
||||
0.62642303 0.95762994 0.22169909 0.82717721]
|
||||
[0.8470287 0.16761991 0.74042291 0.42143986 0.70262543 0.8964059
|
||||
0.69629255 0.05916189 0.89940861 0.19010909]]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2115,13 +2125,13 @@ 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.022210866177877393
|
||||
3.7588118737641243
|
||||
0.5615739502773949
|
||||
[[ 1.30150056 3.81953844 7.0377961 ]
|
||||
[ 3.81953844 12.2361161 19.72546953]
|
||||
[ 7.0377961 19.72546953 73.31248389]]
|
||||
[79.90960269 0.08394792 6.85654993]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>-0.1804736801658276
|
||||
3.577421319924605
|
||||
-0.13894606338836166
|
||||
[[ 0.93900613 3.09173024 2.71615146]
|
||||
[ 3.09173024 11.22689573 9.13261905]
|
||||
[ 2.71615146 9.13261905 12.06931309]]
|
||||
[21.60398689 0.07438088 2.55684718]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2344,7 +2354,7 @@ Name: Aragorn, dtype: object
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31718/1326197715.py:6: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11068/1326197715.py:6: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
|
||||
data_pandas=data_pandas.append(pd.DataFrame(new_hobbit, index=['Pippin']))
|
||||
</pre></div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
@@ -1696,7 +1706,7 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.995840825550726
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.9955273625597437
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1713,7 +1723,7 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.007607459165915922
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.008900933315885705
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1728,23 +1738,23 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.00552246 0.00115669 0.02017377 0.01896127 0.01389847 0.01591021
|
||||
0.02816083 0.0100949 0.02757522 0.00182747 0.00584432 0.02081274
|
||||
0.01365363 0.0191717 0.01068907 0.02763182 0.02950229 0.02485679
|
||||
0.01456159 0.00644939 0.0297291 0.08272096 0.01335857 0.00825399
|
||||
0.04478101 0.05834444 0.04198166 0.034985 0.00562524 0.01524072
|
||||
0.01529708 0.02083512 0.01161357 0.01708691 0.02279888 0.02912421
|
||||
0.00076617 0.02329285 0.00626773 0.01054509 0.00460405 0.01476097
|
||||
0.0036718 0.00569405 0.07804489 0.03894873 0.02103178 0.00726135
|
||||
0.00353575 0.00857028 0.00923278 0.01616709 0.02881357 0.00550379
|
||||
0.02942218 0.00946636 0.03982972 0.0149713 0.04103307 0.05526765
|
||||
0.00463639 0.00254359 0.00915433 0.02588522 0.00090992 0.00739382
|
||||
0.02075115 0.024632 0.00115506 0.01963203 0.00086063 0.01580414
|
||||
0.01059601 0.03376827 0.02745507 0.02109939 0.05977068 0.04662395
|
||||
0.00283853 0.03903968 0.0001225 0.02385515 0.02089297 0.04214702
|
||||
0.01289962 0.00798188 0.04746791 0.04822955 0.02066371 0.01045774
|
||||
0.01164198 0.03633213 0.00183398 0.0105301 0.00880924 0.015244
|
||||
0.01596986 0.01176096 0.01448147 0.00610607]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.00643899 0.04246989 0.0607062 0.02997344 0.0011878 0.00123457
|
||||
0.00324986 0.03285652 0.01028728 0.01571866 0.03940381 0.0814985
|
||||
0.038844 0.01828593 0.03967758 0.00303693 0.02227466 0.02702328
|
||||
0.00026861 0.00883798 0.02876697 0.00472251 0.03141454 0.02911162
|
||||
0.02387339 0.00585113 0.00110716 0.00587564 0.00693821 0.00604105
|
||||
0.00804985 0.02058094 0.01151984 0.01782721 0.0286851 0.08874631
|
||||
0.01678538 0.0065912 0.03611471 0.02706508 0.00313125 0.04977093
|
||||
0.00415289 0.02760079 0.00518122 0.00628874 0.00739489 0.01619456
|
||||
0.00996972 0.02210753 0.02030107 0.02100763 0.04699527 0.01512934
|
||||
0.00717079 0.01784714 0.01095703 0.01281486 0.0231703 0.04482932
|
||||
0.00287871 0.0565419 0.04028659 0.03102525 0.01617722 0.0271761
|
||||
0.01736502 0.03394827 0.00328494 0.05750876 0.0059888 0.01915888
|
||||
0.01423609 0.01024227 0.03660869 0.01012951 0.00534938 0.03375068
|
||||
0.02699539 0.04083439 0.04965227 0.00565625 0.02250553 0.00893027
|
||||
0.02244755 0.00741987 0.00189101 0.02042476 0.02036545 0.06362348
|
||||
0.03145163 0.02987833 0.07393685 0.0033575 0.02791218 0.00214832
|
||||
0.0111154 0.01344581 0.00368581 0.01436601]
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1813,15 +1823,15 @@ but now splitting the data into a training set and a test set.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 2.04899609 -0.34193915 5.64527549 -0.69997503 0.31290684]
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 2.09851217 -1.48209629 10.27096183 -6.79998516 2.87206824]
|
||||
Training R2
|
||||
0.9952222065466447
|
||||
0.9957273060382023
|
||||
Training MSE
|
||||
0.008897354602673473
|
||||
0.010053880703541525
|
||||
Test R2
|
||||
0.9915165982451293
|
||||
0.9888005551376943
|
||||
Test MSE
|
||||
0.009442796383765939
|
||||
0.008043926731954223
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
@@ -1817,7 +1827,7 @@ theorem.</p>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Bootstrap Statistics :
|
||||
original bias std. error
|
||||
100.115 15.1213 100.117 0.151517
|
||||
99.9889 15.1336 99.9892 0.150749
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2079,7 +2089,9 @@ Error: 0.026605727637184558
|
||||
Bias^2: 0.010018312644139219
|
||||
Var: 0.016587414993045335
|
||||
0.026605727637184558 >= 0.010018312644139219 + 0.016587414993045335 = 0.026605727637184554
|
||||
Polynomial degree: 10
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 10
|
||||
Error: 0.021592704588021178
|
||||
Bias^2: 0.010516485576646504
|
||||
Var: 0.01107621901137467
|
||||
@@ -2089,23 +2101,19 @@ Error: 0.07160048164232538
|
||||
Bias^2: 0.014436800088896381
|
||||
Var: 0.05716368155342902
|
||||
0.07160048164232538 >= 0.014436800088896381 + 0.05716368155342902 = 0.0716004816423254
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 12
|
||||
Polynomial degree: 12
|
||||
Error: 0.11547777218876518
|
||||
Bias^2: 0.016285782696017142
|
||||
Var: 0.09919198949274803
|
||||
0.11547777218876518 >= 0.016285782696017142 + 0.09919198949274803 = 0.11547777218876518
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 13
|
||||
Polynomial degree: 13
|
||||
Error: 0.2284246870217162
|
||||
Bias^2: 0.01975416527168255
|
||||
Var: 0.20867052175003364
|
||||
0.2284246870217162 >= 0.01975416527168255 + 0.20867052175003364 = 0.2284246870217162
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week37_162_4.png" src="_images/week37_162_4.png" />
|
||||
<img alt="_images/week37_162_3.png" src="_images/week37_162_3.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2558,9 +2566,9 @@ Mean squared error on training data: 0.00063862
|
||||
Mean squared error on test data: 3073.63180447
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31736/626635268.py:73: RuntimeWarning: divide by zero encountered in log10
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11090/626635268.py:73: RuntimeWarning: divide by zero encountered in log10
|
||||
plt.plot(polynomial, np.log10(trainingerror), label='Training Error')
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31736/626635268.py:74: RuntimeWarning: divide by zero encountered in log10
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11090/626635268.py:74: RuntimeWarning: divide by zero encountered in log10
|
||||
plt.plot(polynomial, np.log10(testerror), label='Test Error')
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2645,7 +2653,7 @@ Mean squared error on test data: 3073.63180447
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31736/3817475779.py:63: RuntimeWarning: divide by zero encountered in log10
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11090/3817475779.py:63: RuntimeWarning: divide by zero encountered in log10
|
||||
plt.plot(polynomial, np.log10(estimated_mse_sklearn), label='Test Error')
|
||||
</pre></div>
|
||||
</div>
|
||||
|
||||
@@ -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">
|
||||
@@ -2034,7 +2044,7 @@ case under study.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>RandomizedSearchCV(estimator=Ridge(), n_iter=100,
|
||||
param_distributions={'alpha': <scipy.stats._distn_infrastructure.rv_frozen object at 0x156346610>})
|
||||
param_distributions={'alpha': <scipy.stats._distn_infrastructure.rv_frozen object at 0x1045a7eb0>})
|
||||
Best estimated lambda-value: 0.9849967686928113
|
||||
MSE score: 1.0853136633465326
|
||||
R2 score: -0.0002382102844775691
|
||||
|
||||
@@ -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">
|
||||
@@ -1798,11 +1808,11 @@ which equals</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31749/3838917029.py:18: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11106/3838917029.py:18: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
|
||||
ax = fig.gca(projection="3d")
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><mpl_toolkits.mplot3d.art3d.Poly3DCollection at 0x11ada9670>
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span><mpl_toolkits.mplot3d.art3d.Poly3DCollection at 0x136af27c0>
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week39_80_2.png" src="_images/week39_80_2.png" />
|
||||
@@ -1860,7 +1870,7 @@ which equals</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[<matplotlib.lines.Line2D at 0x11f5f6520>]
|
||||
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[<matplotlib.lines.Line2D at 0x13792dfa0>]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week39_88_1.png" src="_images/week39_88_1.png" />
|
||||
|
||||
@@ -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">
|
||||
@@ -1446,15 +1456,15 @@ function.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Own inversion
|
||||
[[4.42484459]
|
||||
[2.65626992]]
|
||||
Eigenvalues of Hessian Matrix:[0.30361418 4.06484621]
|
||||
[[3.88391015]
|
||||
[3.15024162]]
|
||||
Eigenvalues of Hessian Matrix:[0.29734306 4.63081005]
|
||||
theta from own gd
|
||||
[[4.42484459]
|
||||
[2.65626992]]
|
||||
[[3.88391015]
|
||||
[3.15024162]]
|
||||
theta from own sdg
|
||||
[[4.53049637]
|
||||
[2.68581655]]
|
||||
[[3.92822216]
|
||||
[3.17648722]]
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week40_25_1.png" src="_images/week40_25_1.png" />
|
||||
|
||||
@@ -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">
|
||||
@@ -2795,7 +2805,7 @@ the <em>Hadamard product</em>, meaning element-wise multiplication.</p>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Old accuracy on training data: 0.1440501043841336
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3131,7 +3141,7 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.19166666666666668
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3140,7 +3150,7 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3149,7 +3159,7 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3158,7 +3168,7 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3167,7 +3177,7 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3176,7 +3186,7 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3185,7 +3195,7 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3194,11 +3204,11 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.09166666666666666
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3207,11 +3217,11 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3220,11 +3230,11 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3233,11 +3243,11 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3246,11 +3256,11 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3259,7 +3269,7 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3268,11 +3278,11 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3281,11 +3291,11 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3294,11 +3304,11 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3307,11 +3317,11 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3320,11 +3330,11 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3333,11 +3343,11 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3346,11 +3356,11 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3359,11 +3369,11 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3416,15 +3426,15 @@ Accuracy score on test set: 0.07777777777777778
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31761/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11118/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -3688,8 +3698,9 @@ Accuracy score on test set: 0.9888888888888889
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.9722222222222222
|
||||
|
||||
Learning rate = 0.01
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.01
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.9527777777777777
|
||||
</pre></div>
|
||||
@@ -3750,8 +3761,9 @@ Accuracy score on test set: 0.08333333333333333
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1.0
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
|
||||
Learning rate = 1.0
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.09444444444444444
|
||||
|
||||
@@ -3771,8 +3783,9 @@ Accuracy score on test set: 0.10555555555555556
|
||||
Learning rate = 10.0
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.1388888888888889
|
||||
|
||||
Learning rate = 10.0
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 10.0
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.11388888888888889
|
||||
</pre></div>
|
||||
@@ -4208,8 +4221,9 @@ Accuracy score on data set: 0.5
|
||||
Learning rate = 1.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
Learning rate = 10.0
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 10.0
|
||||
Lambda = 1e-05
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
@@ -4260,7 +4274,7 @@ Accuracy score on data set: 0.5
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week41_211_2.png" src="_images/week41_211_2.png" />
|
||||
<img alt="_images/week41_211_3.png" src="_images/week41_211_3.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -55,7 +55,7 @@ const thebe_selector_output = ".output, .cell_output"
|
||||
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="search.html" />
|
||||
<link rel="next" title="Project 1 on Machine Learning, deadline October 9 (midnight), 2023" href="project1.html" />
|
||||
<link rel="next" title="Exercises weeks 43 and 44" href="exercisesweek43.html" />
|
||||
<link rel="prev" title="Exercises week 42" href="exercisesweek42.html" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="docsearch:language" content="None">
|
||||
@@ -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">
|
||||
@@ -1675,7 +1685,7 @@ the <em>Hadamard product</em>, meaning element-wise multiplication.</p>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Old accuracy on training data: 0.1440501043841336
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2011,7 +2021,7 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.19166666666666668
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2020,7 +2030,7 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2029,7 +2039,7 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2038,7 +2048,7 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2047,7 +2057,7 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2056,7 +2066,7 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2065,7 +2075,7 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2074,11 +2084,11 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.09166666666666666
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2087,11 +2097,11 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2100,11 +2110,11 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2113,11 +2123,11 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2126,11 +2136,11 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2139,7 +2149,7 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2148,11 +2158,11 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2161,11 +2171,11 @@ Lambda = 10.0
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2174,11 +2184,11 @@ Lambda = 1e-05
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2187,11 +2197,11 @@ Lambda = 0.0001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2200,11 +2210,11 @@ Lambda = 0.001
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2213,11 +2223,11 @@ Lambda = 0.01
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2226,11 +2236,11 @@ Lambda = 0.1
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2239,11 +2249,11 @@ Lambda = 1.0
|
||||
Accuracy score on test set: 0.07777777777777778
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:43: RuntimeWarning: overflow encountered in exp
|
||||
exp_term = np.exp(self.z_o)
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/1630775253.py:44: RuntimeWarning: invalid value encountered in true_divide
|
||||
self.probabilities = exp_term / np.sum(exp_term, axis=1, keepdims=True)
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2296,15 +2306,15 @@ Accuracy score on test set: 0.07777777777777778
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31871/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_11123/953065564.py:4: RuntimeWarning: overflow encountered in exp
|
||||
return 1/(1 + np.exp(-x))
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -2608,39 +2618,40 @@ Accuracy score on test set: 0.8666666666666667
|
||||
Learning rate = 1.0
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.08611111111111111
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1.0
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 0.0001
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1.0
|
||||
Lambda = 0.001
|
||||
Accuracy score on test set: 0.10555555555555556
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 0.01
|
||||
Accuracy score on test set: 0.17777777777777778
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 0.1
|
||||
Accuracy score on test set: 0.08333333333333333
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 1.0
|
||||
Lambda = 1.0
|
||||
Accuracy score on test set: 0.08888888888888889
|
||||
|
||||
Learning rate = 1.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on test set: 0.09444444444444444
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.17222222222222222
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 10.0
|
||||
Lambda = 1e-05
|
||||
Accuracy score on test set: 0.17222222222222222
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 0.0001
|
||||
Accuracy score on test set: 0.11666666666666667
|
||||
|
||||
@@ -3105,9 +3116,18 @@ Accuracy score on data set: 0.5
|
||||
Learning rate = 10.0
|
||||
Lambda = 0.01
|
||||
Accuracy score on data set: 0.5
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate =
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 0.1
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 1.0
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on data set: 0.5
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:692: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet.
|
||||
@@ -3132,20 +3152,7 @@ Accuracy score on data set: 0.5
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> 10.0
|
||||
Lambda = 0.1
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 1.0
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
Learning rate = 10.0
|
||||
Lambda = 10.0
|
||||
Accuracy score on data set: 0.5
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week42_88_4.png" src="_images/week42_88_4.png" />
|
||||
<img alt="_images/week42_88_2.png" src="_images/week42_88_2.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3829,10 +3836,10 @@ features).</p>
|
||||
<p class="prev-next-title">Exercises week 42</p>
|
||||
</div>
|
||||
</a>
|
||||
<a class='right-next' id="next-link" href="project1.html" title="next page">
|
||||
<a class='right-next' id="next-link" href="exercisesweek43.html" title="next page">
|
||||
<div class="prev-next-info">
|
||||
<p class="prev-next-subtitle">next</p>
|
||||
<p class="prev-next-title">Project 1 on Machine Learning, deadline October 9 (midnight), 2023</p>
|
||||
<p class="prev-next-title">Exercises weeks 43 and 44</p>
|
||||
</div>
|
||||
<i class="fas fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
@@ -1888,8 +1888,9 @@ Accuracy score on data set: 0.5
|
||||
Learning rate = 0.0001
|
||||
Lambda = 1.0
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
Learning rate = 0.0001
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Learning rate = 0.0001
|
||||
Lambda = 10.0
|
||||
Accuracy score on data set: 0.5
|
||||
|
||||
@@ -2056,7 +2057,7 @@ Accuracy score on data set: 0.5
|
||||
warnings.warn(
|
||||
</pre></div>
|
||||
</div>
|
||||
<img alt="_images/week43_30_2.png" src="_images/week43_30_2.png" />
|
||||
<img alt="_images/week43_30_3.png" src="_images/week43_30_3.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6361,12 +6362,8 @@ case.</p>
|
||||
</div>
|
||||
<div class="cell_output docutils container">
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Adam: Eta=0.001, Lambda=0
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> [----------------------------------------] 0.000% | train_error: 12.9 | train_acc: 0.376 | val_error: 12.6 | val_acc: 0.392
|
||||
|
||||
[----------------------------------------] 0.000% | train_error: 12.9 | train_acc: 0.376 | val_error: 12.6 | val_acc: 0.392
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span> [----------------------------------------] 0.1000% | train_error: 12.9 | train_acc: 0.376 | val_error: 12.6 | val_acc: 0.392
|
||||
@@ -18835,7 +18832,9 @@ probabilities sum up to: 1.0
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>predictions = (n_inputs) = (1437,)
|
||||
prediction for image 0: 8
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>prediction for image 0: 8
|
||||
correct label for image 0: 6
|
||||
</pre></div>
|
||||
</div>
|
||||
|
||||
@@ -3023,10 +3023,7 @@
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/wrap_util.py:20\u001b[0m, in \u001b[0;36munary_to_nary.<locals>.nary_operator.<locals>.nary_f\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 19\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtuple\u001b[39m(args[i] \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m argnum)\n\u001b[0;32m---> 20\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43munary_operator\u001b[49m\u001b[43m(\u001b[49m\u001b[43munary_f\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mnary_op_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mnary_op_kwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/differential_operators.py:29\u001b[0m, in \u001b[0;36mgrad\u001b[0;34m(fun, x)\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m vspace(ans)\u001b[38;5;241m.\u001b[39msize \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[1;32m 27\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mGrad only applies to real scalar-output functions. \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 28\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTry jacobian, elementwise_grad or holomorphic_grad.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 29\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mvjp\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvspace\u001b[49m\u001b[43m(\u001b[49m\u001b[43mans\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mones\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n",
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:14\u001b[0m, in \u001b[0;36mmake_vjp.<locals>.vjp\u001b[0;34m(g)\u001b[0m\n\u001b[0;32m---> 14\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mvjp\u001b[39m(g): \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mbackward_pass\u001b[49m\u001b[43m(\u001b[49m\u001b[43mg\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend_node\u001b[49m\u001b[43m)\u001b[49m\n",
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:23\u001b[0m, in \u001b[0;36mbackward_pass\u001b[0;34m(g, end_node)\u001b[0m\n\u001b[1;32m 21\u001b[0m ingrads \u001b[38;5;241m=\u001b[39m node\u001b[38;5;241m.\u001b[39mvjp(outgrad[\u001b[38;5;241m0\u001b[39m])\n\u001b[1;32m 22\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m parent, ingrad \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(node\u001b[38;5;241m.\u001b[39mparents, ingrads):\n\u001b[0;32m---> 23\u001b[0m outgrads[parent] \u001b[38;5;241m=\u001b[39m \u001b[43madd_outgrads\u001b[49m\u001b[43m(\u001b[49m\u001b[43moutgrads\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparent\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mingrad\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m outgrad[\u001b[38;5;241m0\u001b[39m]\n",
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:165\u001b[0m, in \u001b[0;36madd_outgrads\u001b[0;34m(prev_g_flagged, g)\u001b[0m\n\u001b[1;32m 163\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m mutable:\n\u001b[1;32m 164\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m sparse:\n\u001b[0;32m--> 165\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msparse_add\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprev_g\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mg\u001b[49m\u001b[43m)\u001b[49m, \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 166\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 167\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m vs\u001b[38;5;241m.\u001b[39mmut_add(prev_g, g), \u001b[38;5;28;01mTrue\u001b[39;00m\n",
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/tracer.py:48\u001b[0m, in \u001b[0;36mprimitive.<locals>.f_wrapped\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 46\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m new_box(ans, trace, node)\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mf_raw\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:186\u001b[0m, in \u001b[0;36msparse_add\u001b[0;34m(vs, x_prev, x_new)\u001b[0m\n\u001b[1;32m 183\u001b[0m \u001b[38;5;129m@primitive\u001b[39m\n\u001b[1;32m 184\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21msparse_add\u001b[39m(vs, x_prev, x_new):\n\u001b[1;32m 185\u001b[0m x_prev \u001b[38;5;241m=\u001b[39m x_prev \u001b[38;5;28;01mif\u001b[39;00m x_prev \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m vs\u001b[38;5;241m.\u001b[39mzeros()\n\u001b[0;32m--> 186\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mx_new\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmut_add\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx_prev\u001b[49m\u001b[43m)\u001b[49m\n",
|
||||
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:23\u001b[0m, in \u001b[0;36mbackward_pass\u001b[0;34m(g, end_node)\u001b[0m\n\u001b[1;32m 21\u001b[0m ingrads \u001b[38;5;241m=\u001b[39m node\u001b[38;5;241m.\u001b[39mvjp(outgrad[\u001b[38;5;241m0\u001b[39m])\n\u001b[1;32m 22\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m parent, ingrad \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(node\u001b[38;5;241m.\u001b[39mparents, ingrads):\n\u001b[0;32m---> 23\u001b[0m outgrads[parent] \u001b[38;5;241m=\u001b[39m add_outgrads(\u001b[43moutgrads\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparent\u001b[49m\u001b[43m)\u001b[49m, ingrad)\n\u001b[1;32m 24\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m outgrad[\u001b[38;5;241m0\u001b[39m]\n",
|
||||
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1382,7 +1382,7 @@
|
||||
"text": [
|
||||
"/Users/mhjensen/miniforge3/envs/myenv/lib/python3.9/site-packages/keras/optimizer_v2/gradient_descent.py:102: UserWarning: The `lr` argument is deprecated, use `learning_rate` instead.\n",
|
||||
" super(SGD, self).__init__(name, **kwargs)\n",
|
||||
"2023-10-15 21:48:58.909327: W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz\n"
|
||||
"2023-10-25 15:31:33.965944: W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |