diff --git a/doc/pub/week40/html/._week40-bs000.html b/doc/pub/week40/html/._week40-bs000.html
index a7a4a3ac7..bf08b9260 100644
--- a/doc/pub/week40/html/._week40-bs000.html
+++ b/doc/pub/week40/html/._week40-bs000.html
@@ -325,7 +325,7 @@ MathJax.Hub.Config({
# Importing various packages
+# Importing various packages
from math import exp, sqrt
from random import random, seed
import numpy as np
import matplotlib.pyplot as plt
-from sklearn.linear_model import SGDRegressor
-n = 1000
+n = 100
x = 2*np.random.rand(n,1)
y = 4+3*x+np.random.randn(n,1)
X = np.c_[np.ones((n,1)), x]
+XT_X = X.T @ X
theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
print("Own inversion")
print(theta_linreg)
-sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
-sgdreg.fit(x,y.ravel())
-print("sgdreg from scikit")
-print(sgdreg.intercept_, sgdreg.coef_)
-
+# Hessian matrix
+H = (2.0/n)* XT_X
+EigValues, EigVectors = np.linalg.eig(H)
+print(f"Eigenvalues of Hessian Matrix:{EigValues}")
theta = np.random.randn(2,1)
-eta = 0.1
+eta = 1.0/np.max(EigValues)
Niterations = 1000
@@ -353,7 +353,6 @@ Xnew = np.= Xnew.dot(theta)
ypredict2 = Xnew.dot(theta_linreg)
-
n_epochs = 50
M = 5 #size of each minibatch
m = int(n/M) #number of minibatches
@@ -364,16 +363,20 @@ t0, t1 = 5= np.random.randn(2,1)
for epoch in range(n_epochs):
+# Can you figure out a better way of setting up the contributions to each batch?
for i in range(m):
random_index = np.random.randint(m)
- xi = X[random_index:random_index+m]
- yi = y[random_index:random_index+m]
- gradients = 2.0* xi.T @ ((xi @ theta)-yi)
+ xi = X[random_index*M:random_index*M+M]
+ yi = y[random_index*M:random_index*M+M]
+ gradients = (2.0/M)* xi.T @ ((xi @ theta)-yi)
eta = learning_schedule(epoch*m+i)
theta = theta - eta*gradients
print("theta from own sdg")
print(theta)
+
+
+
plt.plot(xnew, ypredict, "r-")
plt.plot(xnew, ypredict2, "b-")
plt.plot(x, y ,'ro')
diff --git a/doc/pub/week40/html/week40-bs.html b/doc/pub/week40/html/week40-bs.html
index a7a4a3ac7..bf08b9260 100644
--- a/doc/pub/week40/html/week40-bs.html
+++ b/doc/pub/week40/html/week40-bs.html
@@ -325,7 +325,7 @@ MathJax.Hub.Config({
-Nov 2, 2021
+Nov 3, 2021
diff --git a/doc/pub/week40/html/week40-reveal.html b/doc/pub/week40/html/week40-reveal.html
index ff1024f38..3aad4d3c1 100644
--- a/doc/pub/week40/html/week40-reveal.html
+++ b/doc/pub/week40/html/week40-reveal.html
@@ -184,7 +184,7 @@ MathJax.Hub.Config({
-Nov 2, 2021
+Nov 3, 2021
@@ -499,28 +499,28 @@ j = 0
# Importing various packages
+# Importing various packages
from math import exp, sqrt
from random import random, seed
import numpy as np
import matplotlib.pyplot as plt
-from sklearn.linear_model import SGDRegressor
-n = 1000
+n = 100
x = 2*np.random.rand(n,1)
y = 4+3*x+np.random.randn(n,1)
X = np.c_[np.ones((n,1)), x]
+XT_X = X.T @ X
theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
print("Own inversion")
print(theta_linreg)
-sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
-sgdreg.fit(x,y.ravel())
-print("sgdreg from scikit")
-print(sgdreg.intercept_, sgdreg.coef_)
-
+# Hessian matrix
+H = (2.0/n)* XT_X
+EigValues, EigVectors = np.linalg.eig(H)
+print(f"Eigenvalues of Hessian Matrix:{EigValues}")
theta = np.random.randn(2,1)
-eta = 0.1
+eta = 1.0/np.max(EigValues)
Niterations = 1000
@@ -535,7 +535,6 @@ Xnew = np.c_[np.ones((2,50
M = 5 #size of each minibatch
m = int(n/M) #number of minibatches
@@ -546,16 +545,20 @@ t0, t1 = 5, 50<
theta = np.random.randn(2,1)
for epoch in range(n_epochs):
+# Can you figure out a better way of setting up the contributions to each batch?
for i in range(m):
random_index = np.random.randint(m)
- xi = X[random_index:random_index+m]
- yi = y[random_index:random_index+m]
- gradients = 2.0* xi.T @ ((xi @ theta)-yi)
+ xi = X[random_index*M:random_index*M+M]
+ yi = y[random_index*M:random_index*M+M]
+ gradients = (2.0/M)* xi.T @ ((xi @ theta)-yi)
eta = learning_schedule(epoch*m+i)
theta = theta - eta*gradients
print("theta from own sdg")
print(theta)
+
+
+
plt.plot(xnew, ypredict, "r-")
plt.plot(xnew, ypredict2, "b-")
plt.plot(x, y ,'ro')
diff --git a/doc/pub/week40/html/week40-solarized.html b/doc/pub/week40/html/week40-solarized.html
index 087358769..d3532d62a 100644
--- a/doc/pub/week40/html/week40-solarized.html
+++ b/doc/pub/week40/html/week40-solarized.html
@@ -261,7 +261,7 @@ MathJax.Hub.Config({
-Nov 2, 2021
+Nov 3, 2021
@@ -546,28 +546,28 @@ j = 0
# Importing various packages
+# Importing various packages
from math import exp, sqrt
from random import random, seed
import numpy as np
import matplotlib.pyplot as plt
-from sklearn.linear_model import SGDRegressor
-n = 1000
+n = 100
x = 2*np.random.rand(n,1)
y = 4+3*x+np.random.randn(n,1)
X = np.c_[np.ones((n,1)), x]
+XT_X = X.T @ X
theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
print("Own inversion")
print(theta_linreg)
-sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
-sgdreg.fit(x,y.ravel())
-print("sgdreg from scikit")
-print(sgdreg.intercept_, sgdreg.coef_)
-
+# Hessian matrix
+H = (2.0/n)* XT_X
+EigValues, EigVectors = np.linalg.eig(H)
+print(f"Eigenvalues of Hessian Matrix:{EigValues}")
theta = np.random.randn(2,1)
-eta = 0.1
+eta = 1.0/np.max(EigValues)
Niterations = 1000
@@ -582,7 +582,6 @@ Xnew = np.c_[np.ones((2,50
M = 5 #size of each minibatch
m = int(n/M) #number of minibatches
@@ -593,16 +592,20 @@ t0, t1 = 5, 50<
theta = np.random.randn(2,1)
for epoch in range(n_epochs):
+# Can you figure out a better way of setting up the contributions to each batch?
for i in range(m):
random_index = np.random.randint(m)
- xi = X[random_index:random_index+m]
- yi = y[random_index:random_index+m]
- gradients = 2.0* xi.T @ ((xi @ theta)-yi)
+ xi = X[random_index*M:random_index*M+M]
+ yi = y[random_index*M:random_index*M+M]
+ gradients = (2.0/M)* xi.T @ ((xi @ theta)-yi)
eta = learning_schedule(epoch*m+i)
theta = theta - eta*gradients
print("theta from own sdg")
print(theta)
+
+
+
plt.plot(xnew, ypredict, "r-")
plt.plot(xnew, ypredict2, "b-")
plt.plot(x, y ,'ro')
diff --git a/doc/pub/week40/html/week40.html b/doc/pub/week40/html/week40.html
index 5d49816a9..da6c5d4ee 100644
--- a/doc/pub/week40/html/week40.html
+++ b/doc/pub/week40/html/week40.html
@@ -338,7 +338,7 @@ MathJax.Hub.Config({
-Nov 2, 2021
+Nov 3, 2021
@@ -623,28 +623,28 @@ j = 0
# Importing various packages
+# Importing various packages
from math import exp, sqrt
from random import random, seed
import numpy as np
import matplotlib.pyplot as plt
-from sklearn.linear_model import SGDRegressor
-n = 1000
+n = 100
x = 2*np.random.rand(n,1)
y = 4+3*x+np.random.randn(n,1)
X = np.c_[np.ones((n,1)), x]
+XT_X = X.T @ X
theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
print("Own inversion")
print(theta_linreg)
-sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
-sgdreg.fit(x,y.ravel())
-print("sgdreg from scikit")
-print(sgdreg.intercept_, sgdreg.coef_)
-
+# Hessian matrix
+H = (2.0/n)* XT_X
+EigValues, EigVectors = np.linalg.eig(H)
+print(f"Eigenvalues of Hessian Matrix:{EigValues}")
theta = np.random.randn(2,1)
-eta = 0.1
+eta = 1.0/np.max(EigValues)
Niterations = 1000
@@ -659,7 +659,6 @@ Xnew = np.= Xnew.dot(theta)
ypredict2 = Xnew.dot(theta_linreg)
-
n_epochs = 50
M = 5 #size of each minibatch
m = int(n/M) #number of minibatches
@@ -670,16 +669,20 @@ t0, t1 = 5= np.random.randn(2,1)
for epoch in range(n_epochs):
+# Can you figure out a better way of setting up the contributions to each batch?
for i in range(m):
random_index = np.random.randint(m)
- xi = X[random_index:random_index+m]
- yi = y[random_index:random_index+m]
- gradients = 2.0* xi.T @ ((xi @ theta)-yi)
+ xi = X[random_index*M:random_index*M+M]
+ yi = y[random_index*M:random_index*M+M]
+ gradients = (2.0/M)* xi.T @ ((xi @ theta)-yi)
eta = learning_schedule(epoch*m+i)
theta = theta - eta*gradients
print("theta from own sdg")
print(theta)
+
+
+
plt.plot(xnew, ypredict, "r-")
plt.plot(xnew, ypredict2, "b-")
plt.plot(x, y ,'ro')
diff --git a/doc/pub/week40/ipynb/ipynb-week40-src.tar.gz b/doc/pub/week40/ipynb/ipynb-week40-src.tar.gz
index 44284d7bd..7878018fc 100644
Binary files a/doc/pub/week40/ipynb/ipynb-week40-src.tar.gz and b/doc/pub/week40/ipynb/ipynb-week40-src.tar.gz differ
diff --git a/doc/pub/week40/ipynb/week40.ipynb b/doc/pub/week40/ipynb/week40.ipynb
index a86a23c43..48a946bd2 100644
--- a/doc/pub/week40/ipynb/week40.ipynb
+++ b/doc/pub/week40/ipynb/week40.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "33a7f33a",
+ "id": "8c1bc594",
"metadata": {
"editable": true
},
@@ -14,7 +14,7 @@
},
{
"cell_type": "markdown",
- "id": "eb6961f1",
+ "id": "532d5f80",
"metadata": {
"editable": true
},
@@ -22,14 +22,14 @@
"# Week 40: From Stochastic Gradient Descent to Neural networks\n",
"**Morten Hjorth-Jensen**, Department of Physics, University of Oslo, Norway and Department of Physics and Astronomy and Facility for Rare Ion Beams, Michigan State University, USA\n",
"\n",
- "Date: **Nov 2, 2021**\n",
+ "Date: **Nov 3, 2021**\n",
"\n",
"Copyright 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license"
]
},
{
"cell_type": "markdown",
- "id": "5d9b6f73",
+ "id": "642ef5f2",
"metadata": {
"editable": true
},
@@ -51,7 +51,7 @@
},
{
"cell_type": "markdown",
- "id": "896b7e7c",
+ "id": "388d28a9",
"metadata": {
"editable": true
},
@@ -63,7 +63,7 @@
},
{
"cell_type": "markdown",
- "id": "5285634a",
+ "id": "811c319c",
"metadata": {
"editable": true
},
@@ -85,7 +85,7 @@
},
{
"cell_type": "markdown",
- "id": "3a063b42",
+ "id": "4e7a70d6",
"metadata": {
"editable": true
},
@@ -117,7 +117,7 @@
},
{
"cell_type": "markdown",
- "id": "286abf6d",
+ "id": "1a453559",
"metadata": {
"editable": true
},
@@ -134,7 +134,7 @@
},
{
"cell_type": "markdown",
- "id": "91f5da81",
+ "id": "323d7ab6",
"metadata": {
"editable": true
},
@@ -147,7 +147,7 @@
},
{
"cell_type": "markdown",
- "id": "d9a38f58",
+ "id": "61f145c0",
"metadata": {
"editable": true
},
@@ -160,7 +160,7 @@
},
{
"cell_type": "markdown",
- "id": "d782cea1",
+ "id": "954c1b01",
"metadata": {
"editable": true
},
@@ -173,7 +173,7 @@
},
{
"cell_type": "markdown",
- "id": "6b196224",
+ "id": "942eeb65",
"metadata": {
"editable": true
},
@@ -187,7 +187,7 @@
},
{
"cell_type": "markdown",
- "id": "5ec16fda",
+ "id": "f901816b",
"metadata": {
"editable": true
},
@@ -210,7 +210,7 @@
},
{
"cell_type": "markdown",
- "id": "e1f93c6a",
+ "id": "e3aba58e",
"metadata": {
"editable": true
},
@@ -225,7 +225,7 @@
},
{
"cell_type": "markdown",
- "id": "dcbae038",
+ "id": "4ca91e49",
"metadata": {
"editable": true
},
@@ -237,7 +237,7 @@
},
{
"cell_type": "markdown",
- "id": "c18ff285",
+ "id": "e1c5e217",
"metadata": {
"editable": true
},
@@ -250,7 +250,7 @@
},
{
"cell_type": "markdown",
- "id": "5288661b",
+ "id": "c2ad92a4",
"metadata": {
"editable": true
},
@@ -264,7 +264,7 @@
},
{
"cell_type": "markdown",
- "id": "ddfb5d51",
+ "id": "f54810af",
"metadata": {
"editable": true
},
@@ -275,7 +275,7 @@
{
"cell_type": "code",
"execution_count": 1,
- "id": "be52d134",
+ "id": "b6d7a087",
"metadata": {
"collapsed": false,
"editable": true
@@ -300,7 +300,7 @@
},
{
"cell_type": "markdown",
- "id": "cd8c6d07",
+ "id": "aa6b9db7",
"metadata": {
"editable": true
},
@@ -316,7 +316,7 @@
},
{
"cell_type": "markdown",
- "id": "3d3fd6f2",
+ "id": "52dba806",
"metadata": {
"editable": true
},
@@ -337,7 +337,7 @@
},
{
"cell_type": "markdown",
- "id": "4809cc99",
+ "id": "256088f6",
"metadata": {
"editable": true
},
@@ -360,7 +360,7 @@
{
"cell_type": "code",
"execution_count": 2,
- "id": "aac7dff1",
+ "id": "f3809eae",
"metadata": {
"collapsed": false,
"editable": true
@@ -395,7 +395,7 @@
},
{
"cell_type": "markdown",
- "id": "5396bd45",
+ "id": "f8bcda50",
"metadata": {
"editable": true
},
@@ -405,7 +405,7 @@
},
{
"cell_type": "markdown",
- "id": "69a3b8e1",
+ "id": "02040fa6",
"metadata": {
"editable": true
},
@@ -416,7 +416,7 @@
{
"cell_type": "code",
"execution_count": 3,
- "id": "596c9872",
+ "id": "e7919c6b",
"metadata": {
"collapsed": false,
"editable": true
@@ -426,28 +426,28 @@
"%matplotlib inline\n",
"\n",
"# Importing various packages\n",
+ "# Importing various packages\n",
"from math import exp, sqrt\n",
"from random import random, seed\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
- "from sklearn.linear_model import SGDRegressor\n",
"\n",
- "n = 1000\n",
+ "n = 100\n",
"x = 2*np.random.rand(n,1)\n",
"y = 4+3*x+np.random.randn(n,1)\n",
"\n",
"X = np.c_[np.ones((n,1)), x]\n",
+ "XT_X = X.T @ X\n",
"theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)\n",
"print(\"Own inversion\")\n",
"print(theta_linreg)\n",
- "sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)\n",
- "sgdreg.fit(x,y.ravel())\n",
- "print(\"sgdreg from scikit\")\n",
- "print(sgdreg.intercept_, sgdreg.coef_)\n",
- "\n",
+ "# Hessian matrix\n",
+ "H = (2.0/n)* XT_X\n",
+ "EigValues, EigVectors = np.linalg.eig(H)\n",
+ "print(f\"Eigenvalues of Hessian Matrix:{EigValues}\")\n",
"\n",
"theta = np.random.randn(2,1)\n",
- "eta = 0.1\n",
+ "eta = 1.0/np.max(EigValues)\n",
"Niterations = 1000\n",
"\n",
"\n",
@@ -462,7 +462,6 @@
"ypredict = Xnew.dot(theta)\n",
"ypredict2 = Xnew.dot(theta_linreg)\n",
"\n",
- "\n",
"n_epochs = 50\n",
"M = 5 #size of each minibatch\n",
"m = int(n/M) #number of minibatches\n",
@@ -473,16 +472,20 @@
"theta = np.random.randn(2,1)\n",
"\n",
"for epoch in range(n_epochs):\n",
+ "# Can you figure out a better way of setting up the contributions to each batch?\n",
" for i in range(m):\n",
" random_index = np.random.randint(m)\n",
- " xi = X[random_index:random_index+m]\n",
- " yi = y[random_index:random_index+m]\n",
- " gradients = 2.0* xi.T @ ((xi @ theta)-yi)\n",
+ " xi = X[random_index*M:random_index*M+M]\n",
+ " yi = y[random_index*M:random_index*M+M]\n",
+ " gradients = (2.0/M)* xi.T @ ((xi @ theta)-yi)\n",
" eta = learning_schedule(epoch*m+i)\n",
" theta = theta - eta*gradients\n",
"print(\"theta from own sdg\")\n",
"print(theta)\n",
"\n",
+ "\n",
+ "\n",
+ "\n",
"plt.plot(xnew, ypredict, \"r-\")\n",
"plt.plot(xnew, ypredict2, \"b-\")\n",
"plt.plot(x, y ,'ro')\n",
@@ -495,7 +498,7 @@
},
{
"cell_type": "markdown",
- "id": "915d2dc5",
+ "id": "5d71ac48",
"metadata": {
"editable": true
},
@@ -510,7 +513,7 @@
},
{
"cell_type": "markdown",
- "id": "d79babcd",
+ "id": "867a9b01",
"metadata": {
"editable": true
},
@@ -522,7 +525,7 @@
},
{
"cell_type": "markdown",
- "id": "f6717923",
+ "id": "0f97fa56",
"metadata": {
"editable": true
},
@@ -540,7 +543,7 @@
},
{
"cell_type": "markdown",
- "id": "9f63c31d",
+ "id": "5a094f0e",
"metadata": {
"editable": true
},
@@ -559,7 +562,7 @@
},
{
"cell_type": "markdown",
- "id": "428883d0",
+ "id": "16711622",
"metadata": {
"editable": true
},
@@ -571,7 +574,7 @@
},
{
"cell_type": "markdown",
- "id": "d558ee18",
+ "id": "e98517fe",
"metadata": {
"editable": true
},
@@ -581,7 +584,7 @@
},
{
"cell_type": "markdown",
- "id": "ff54e584",
+ "id": "e1a15dbb",
"metadata": {
"editable": true
},
@@ -597,7 +600,7 @@
},
{
"cell_type": "markdown",
- "id": "a7aa3431",
+ "id": "a70edb37",
"metadata": {
"editable": true
},
@@ -609,7 +612,7 @@
},
{
"cell_type": "markdown",
- "id": "052fe58d",
+ "id": "6696a85a",
"metadata": {
"editable": true
},
@@ -619,7 +622,7 @@
},
{
"cell_type": "markdown",
- "id": "d8d61c87",
+ "id": "e16a6dca",
"metadata": {
"editable": true
},
@@ -631,7 +634,7 @@
},
{
"cell_type": "markdown",
- "id": "787f6c88",
+ "id": "7dcdf569",
"metadata": {
"editable": true
},
@@ -641,7 +644,7 @@
},
{
"cell_type": "markdown",
- "id": "b52e2113",
+ "id": "0ff6cc5b",
"metadata": {
"editable": true
},
@@ -653,7 +656,7 @@
},
{
"cell_type": "markdown",
- "id": "9644066b",
+ "id": "c6b1eb53",
"metadata": {
"editable": true
},
@@ -669,7 +672,7 @@
},
{
"cell_type": "markdown",
- "id": "97ee29bc",
+ "id": "982fbbc1",
"metadata": {
"editable": true
},
@@ -681,7 +684,7 @@
},
{
"cell_type": "markdown",
- "id": "4178c6d4",
+ "id": "052ab94c",
"metadata": {
"editable": true
},
@@ -714,7 +717,7 @@
},
{
"cell_type": "markdown",
- "id": "8bb012ed",
+ "id": "277b9792",
"metadata": {
"editable": true
},
@@ -726,7 +729,7 @@
},
{
"cell_type": "markdown",
- "id": "c0f2506e",
+ "id": "b02fbf73",
"metadata": {
"editable": true
},
@@ -744,7 +747,7 @@
},
{
"cell_type": "markdown",
- "id": "8ebfdb6d",
+ "id": "263e6d70",
"metadata": {
"editable": true
},
@@ -754,7 +757,7 @@
},
{
"cell_type": "markdown",
- "id": "306ed0d4",
+ "id": "d6a59e11",
"metadata": {
"editable": true
},
@@ -785,7 +788,7 @@
},
{
"cell_type": "markdown",
- "id": "d21b15f3",
+ "id": "f164f497",
"metadata": {
"editable": true
},
@@ -800,7 +803,7 @@
},
{
"cell_type": "markdown",
- "id": "c1c6244b",
+ "id": "db7798d8",
"metadata": {
"editable": true
},
@@ -818,7 +821,7 @@
},
{
"cell_type": "markdown",
- "id": "ddedc4f9",
+ "id": "b08d5a96",
"metadata": {
"editable": true
},
@@ -830,7 +833,7 @@
},
{
"cell_type": "markdown",
- "id": "1f9233f3",
+ "id": "2383f62d",
"metadata": {
"editable": true
},
@@ -842,7 +845,7 @@
},
{
"cell_type": "markdown",
- "id": "6d297d02",
+ "id": "ffdf0dff",
"metadata": {
"editable": true
},
@@ -860,7 +863,7 @@
},
{
"cell_type": "markdown",
- "id": "20736543",
+ "id": "e2700cd3",
"metadata": {
"editable": true
},
@@ -883,7 +886,7 @@
},
{
"cell_type": "markdown",
- "id": "df520812",
+ "id": "6485e88b",
"metadata": {
"editable": true
},
@@ -901,7 +904,7 @@
},
{
"cell_type": "markdown",
- "id": "799b0364",
+ "id": "36b5e55e",
"metadata": {
"editable": true
},
@@ -913,7 +916,7 @@
},
{
"cell_type": "markdown",
- "id": "fc4260a2",
+ "id": "f85bc211",
"metadata": {
"editable": true
},
@@ -925,7 +928,7 @@
},
{
"cell_type": "markdown",
- "id": "abe10b9e",
+ "id": "2c808a56",
"metadata": {
"editable": true
},
@@ -937,7 +940,7 @@
},
{
"cell_type": "markdown",
- "id": "3a313288",
+ "id": "cf99b4a1",
"metadata": {
"editable": true
},
@@ -949,7 +952,7 @@
},
{
"cell_type": "markdown",
- "id": "86099421",
+ "id": "3c7406c4",
"metadata": {
"editable": true
},
@@ -961,7 +964,7 @@
},
{
"cell_type": "markdown",
- "id": "c7943b16",
+ "id": "a376b1ce",
"metadata": {
"editable": true
},
@@ -978,7 +981,7 @@
},
{
"cell_type": "markdown",
- "id": "43af0139",
+ "id": "c2f2c38b",
"metadata": {
"editable": true
},
@@ -997,7 +1000,7 @@
},
{
"cell_type": "markdown",
- "id": "1ed36e1b",
+ "id": "a3d8feec",
"metadata": {
"editable": true
},
@@ -1009,7 +1012,7 @@
},
{
"cell_type": "markdown",
- "id": "1db90757",
+ "id": "f3f2a63c",
"metadata": {
"editable": true
},
@@ -1029,7 +1032,7 @@
},
{
"cell_type": "markdown",
- "id": "ee252d4e",
+ "id": "1f252b1f",
"metadata": {
"editable": true
},
@@ -1067,7 +1070,7 @@
},
{
"cell_type": "markdown",
- "id": "8b90c6db",
+ "id": "d8cd74d4",
"metadata": {
"editable": true
},
@@ -1079,7 +1082,7 @@
},
{
"cell_type": "markdown",
- "id": "9260c457",
+ "id": "99715e92",
"metadata": {
"editable": true
},
@@ -1089,7 +1092,7 @@
},
{
"cell_type": "markdown",
- "id": "15c207ef",
+ "id": "3b6f1b1a",
"metadata": {
"editable": true
},
@@ -1101,7 +1104,7 @@
},
{
"cell_type": "markdown",
- "id": "7e261104",
+ "id": "87771c9d",
"metadata": {
"editable": true
},
@@ -1112,7 +1115,7 @@
{
"cell_type": "code",
"execution_count": 4,
- "id": "77001fff",
+ "id": "23170622",
"metadata": {
"collapsed": false,
"editable": true
@@ -1157,7 +1160,7 @@
},
{
"cell_type": "markdown",
- "id": "5d3b0dc1",
+ "id": "b3c1f415",
"metadata": {
"editable": true
},
@@ -1174,7 +1177,7 @@
{
"cell_type": "code",
"execution_count": 5,
- "id": "1ffc9379",
+ "id": "1824e405",
"metadata": {
"collapsed": false,
"editable": true
@@ -1202,7 +1205,7 @@
},
{
"cell_type": "markdown",
- "id": "fd871f0b",
+ "id": "96389356",
"metadata": {
"editable": true
},
@@ -1217,7 +1220,7 @@
{
"cell_type": "code",
"execution_count": 6,
- "id": "ddbbd672",
+ "id": "7aca80c4",
"metadata": {
"collapsed": false,
"editable": true
@@ -1261,7 +1264,7 @@
},
{
"cell_type": "markdown",
- "id": "4d6a7aea",
+ "id": "d24d7bd0",
"metadata": {
"editable": true
},
@@ -1271,7 +1274,7 @@
},
{
"cell_type": "markdown",
- "id": "ca7c075b",
+ "id": "efa6b96a",
"metadata": {
"editable": true
},
@@ -1282,7 +1285,7 @@
{
"cell_type": "code",
"execution_count": 7,
- "id": "9229568b",
+ "id": "ac65c960",
"metadata": {
"collapsed": false,
"editable": true
@@ -1310,7 +1313,7 @@
},
{
"cell_type": "markdown",
- "id": "6bc3b22b",
+ "id": "df71ff0a",
"metadata": {
"editable": true
},
@@ -1325,7 +1328,7 @@
},
{
"cell_type": "markdown",
- "id": "ed6fc569",
+ "id": "9c6fe753",
"metadata": {
"editable": true
},
@@ -1336,7 +1339,7 @@
{
"cell_type": "code",
"execution_count": 8,
- "id": "41ee08d4",
+ "id": "f12697f6",
"metadata": {
"collapsed": false,
"editable": true
@@ -1364,7 +1367,7 @@
},
{
"cell_type": "markdown",
- "id": "9734523b",
+ "id": "5ad2ca9d",
"metadata": {
"editable": true
},
@@ -1375,7 +1378,7 @@
{
"cell_type": "code",
"execution_count": 9,
- "id": "ee6fed3e",
+ "id": "911e2808",
"metadata": {
"collapsed": false,
"editable": true
@@ -1400,7 +1403,7 @@
},
{
"cell_type": "markdown",
- "id": "d1a17448",
+ "id": "ec8f10b0",
"metadata": {
"editable": true
},
@@ -1411,7 +1414,7 @@
{
"cell_type": "code",
"execution_count": 10,
- "id": "f5a52deb",
+ "id": "a1a23c38",
"metadata": {
"collapsed": false,
"editable": true
@@ -1447,7 +1450,7 @@
{
"cell_type": "code",
"execution_count": 11,
- "id": "b11ffbe8",
+ "id": "dcffe427",
"metadata": {
"collapsed": false,
"editable": true
@@ -1467,7 +1470,7 @@
},
{
"cell_type": "markdown",
- "id": "f17fe635",
+ "id": "a5e6b797",
"metadata": {
"editable": true
},
@@ -1478,7 +1481,7 @@
{
"cell_type": "code",
"execution_count": 12,
- "id": "9b13fd12",
+ "id": "b8fbe1cc",
"metadata": {
"collapsed": false,
"editable": true
@@ -1516,7 +1519,7 @@
},
{
"cell_type": "markdown",
- "id": "120d5d12",
+ "id": "ed7a967e",
"metadata": {
"editable": true
},
@@ -1526,7 +1529,7 @@
},
{
"cell_type": "markdown",
- "id": "c1a37a71",
+ "id": "cc8cdcc8",
"metadata": {
"editable": true
},
@@ -1540,7 +1543,7 @@
{
"cell_type": "code",
"execution_count": 13,
- "id": "94b90bdb",
+ "id": "1e89b875",
"metadata": {
"collapsed": false,
"editable": true
@@ -1562,7 +1565,7 @@
},
{
"cell_type": "markdown",
- "id": "ca11f81b",
+ "id": "d0d44d2b",
"metadata": {
"editable": true
},
@@ -1572,7 +1575,7 @@
},
{
"cell_type": "markdown",
- "id": "0b54c45e",
+ "id": "02c4400d",
"metadata": {
"editable": true
},
@@ -1583,7 +1586,7 @@
{
"cell_type": "code",
"execution_count": 14,
- "id": "0c11abcc",
+ "id": "4a81ed6c",
"metadata": {
"collapsed": false,
"editable": true
@@ -1605,7 +1608,7 @@
},
{
"cell_type": "markdown",
- "id": "a8667c75",
+ "id": "6c1e51d0",
"metadata": {
"editable": true
},
@@ -1618,7 +1621,7 @@
{
"cell_type": "code",
"execution_count": 15,
- "id": "80798223",
+ "id": "c93c6168",
"metadata": {
"collapsed": false,
"editable": true
@@ -1643,7 +1646,7 @@
},
{
"cell_type": "markdown",
- "id": "34635399",
+ "id": "936ce35d",
"metadata": {
"editable": true
},
@@ -1655,7 +1658,7 @@
{
"cell_type": "code",
"execution_count": 16,
- "id": "65e2eb3b",
+ "id": "cec2a880",
"metadata": {
"collapsed": false,
"editable": true
@@ -1670,7 +1673,7 @@
},
{
"cell_type": "markdown",
- "id": "ada71b25",
+ "id": "a5c005e2",
"metadata": {
"editable": true
},
@@ -1684,7 +1687,7 @@
},
{
"cell_type": "markdown",
- "id": "70f34d32",
+ "id": "4708c1aa",
"metadata": {
"editable": true
},
@@ -1702,7 +1705,7 @@
},
{
"cell_type": "markdown",
- "id": "7050c8c3",
+ "id": "c5ffb67e",
"metadata": {
"editable": true
},
@@ -1726,7 +1729,7 @@
},
{
"cell_type": "markdown",
- "id": "d03113ff",
+ "id": "31fb9927",
"metadata": {
"editable": true
},
@@ -1744,7 +1747,7 @@
},
{
"cell_type": "markdown",
- "id": "a5dbf267",
+ "id": "38211b19",
"metadata": {
"editable": true
},
@@ -1784,7 +1787,7 @@
},
{
"cell_type": "markdown",
- "id": "0bc22463",
+ "id": "6cd8a5b3",
"metadata": {
"editable": true
},
@@ -1813,7 +1816,7 @@
},
{
"cell_type": "markdown",
- "id": "3332e77d",
+ "id": "a701f17b",
"metadata": {
"editable": true
},
@@ -1834,7 +1837,7 @@
},
{
"cell_type": "markdown",
- "id": "b15611ef",
+ "id": "89107870",
"metadata": {
"editable": true
},
@@ -1863,7 +1866,7 @@
},
{
"cell_type": "markdown",
- "id": "49b24b7e",
+ "id": "a4a479f8",
"metadata": {
"editable": true
},
@@ -1884,7 +1887,7 @@
},
{
"cell_type": "markdown",
- "id": "7149cbc4",
+ "id": "13af06a5",
"metadata": {
"editable": true
},
@@ -1905,7 +1908,7 @@
},
{
"cell_type": "markdown",
- "id": "126894d9",
+ "id": "a57b43c4",
"metadata": {
"editable": true
},
@@ -1922,7 +1925,7 @@
},
{
"cell_type": "markdown",
- "id": "e335c763",
+ "id": "dc42c1a6",
"metadata": {
"editable": true
},
@@ -1943,7 +1946,7 @@
},
{
"cell_type": "markdown",
- "id": "479c95b7",
+ "id": "f8a832c6",
"metadata": {
"editable": true
},
@@ -1959,7 +1962,7 @@
},
{
"cell_type": "markdown",
- "id": "e490ff39",
+ "id": "2cb82b85",
"metadata": {
"editable": true
},
@@ -1976,7 +1979,7 @@
{
"cell_type": "code",
"execution_count": 17,
- "id": "609e4e46",
+ "id": "9800a227",
"metadata": {
"collapsed": false,
"editable": true
@@ -2017,7 +2020,7 @@
},
{
"cell_type": "markdown",
- "id": "5d6ebae1",
+ "id": "08c23cad",
"metadata": {
"editable": true
},
@@ -2027,7 +2030,7 @@
},
{
"cell_type": "markdown",
- "id": "51096d56",
+ "id": "8d0cf57a",
"metadata": {
"editable": true
},
@@ -2038,7 +2041,7 @@
{
"cell_type": "code",
"execution_count": 18,
- "id": "9b722481",
+ "id": "35dcf90d",
"metadata": {
"collapsed": false,
"editable": true
@@ -2098,7 +2101,7 @@
},
{
"cell_type": "markdown",
- "id": "597ac9d4",
+ "id": "79155c53",
"metadata": {
"editable": true
},
@@ -2108,7 +2111,7 @@
},
{
"cell_type": "markdown",
- "id": "7e317222",
+ "id": "c3dfa745",
"metadata": {
"editable": true
},
@@ -2119,7 +2122,7 @@
{
"cell_type": "code",
"execution_count": 19,
- "id": "63bb7b09",
+ "id": "24f8bd64",
"metadata": {
"collapsed": false,
"editable": true
@@ -2139,7 +2142,7 @@
},
{
"cell_type": "markdown",
- "id": "d39fc490",
+ "id": "4f86e082",
"metadata": {
"editable": true
},
@@ -2151,7 +2154,7 @@
},
{
"cell_type": "markdown",
- "id": "1d27b52e",
+ "id": "c5039d23",
"metadata": {
"editable": true
},
@@ -2163,7 +2166,7 @@
},
{
"cell_type": "markdown",
- "id": "51579d55",
+ "id": "d2c52889",
"metadata": {
"editable": true
},
@@ -2178,7 +2181,7 @@
},
{
"cell_type": "markdown",
- "id": "e9dcbe0d",
+ "id": "9c3eb61f",
"metadata": {
"editable": true
},
@@ -2190,7 +2193,7 @@
},
{
"cell_type": "markdown",
- "id": "e6cf9e06",
+ "id": "f6eb0654",
"metadata": {
"editable": true
},
@@ -2207,7 +2210,7 @@
},
{
"cell_type": "markdown",
- "id": "31bcac14",
+ "id": "faab9f9d",
"metadata": {
"editable": true
},
@@ -2222,7 +2225,7 @@
},
{
"cell_type": "markdown",
- "id": "64fbd634",
+ "id": "28c00db4",
"metadata": {
"editable": true
},
@@ -2240,7 +2243,7 @@
},
{
"cell_type": "markdown",
- "id": "79c06827",
+ "id": "8372c1f3",
"metadata": {
"editable": true
},
@@ -2252,7 +2255,7 @@
},
{
"cell_type": "markdown",
- "id": "177b422a",
+ "id": "f3b6042b",
"metadata": {
"editable": true
},
@@ -2270,7 +2273,7 @@
},
{
"cell_type": "markdown",
- "id": "d178534a",
+ "id": "e26cffa6",
"metadata": {
"editable": true
},
@@ -2283,7 +2286,7 @@
},
{
"cell_type": "markdown",
- "id": "07204e90",
+ "id": "523ba64d",
"metadata": {
"editable": true
},
@@ -2295,7 +2298,7 @@
},
{
"cell_type": "markdown",
- "id": "7f545b82",
+ "id": "1fb49d41",
"metadata": {
"editable": true
},
@@ -2313,7 +2316,7 @@
},
{
"cell_type": "markdown",
- "id": "416c4399",
+ "id": "651edd7e",
"metadata": {
"editable": true
},
@@ -2331,7 +2334,7 @@
},
{
"cell_type": "markdown",
- "id": "53157449",
+ "id": "114c3156",
"metadata": {
"editable": true
},
@@ -2341,7 +2344,7 @@
},
{
"cell_type": "markdown",
- "id": "4ae0cc46",
+ "id": "6849064a",
"metadata": {
"editable": true
},
@@ -2359,7 +2362,7 @@
},
{
"cell_type": "markdown",
- "id": "c6893135",
+ "id": "e5d8d7c0",
"metadata": {
"editable": true
},
@@ -2378,7 +2381,7 @@
},
{
"cell_type": "markdown",
- "id": "461e12b1",
+ "id": "820f39d2",
"metadata": {
"editable": true
},
@@ -2391,7 +2394,7 @@
},
{
"cell_type": "markdown",
- "id": "57d82440",
+ "id": "4f3e614a",
"metadata": {
"editable": true
},
@@ -2409,7 +2412,7 @@
},
{
"cell_type": "markdown",
- "id": "6a1c9c0e",
+ "id": "a266380d",
"metadata": {
"editable": true
},
@@ -2420,7 +2423,7 @@
},
{
"cell_type": "markdown",
- "id": "864d28f2",
+ "id": "ab7d550c",
"metadata": {
"editable": true
},
@@ -2439,7 +2442,7 @@
},
{
"cell_type": "markdown",
- "id": "f765f92b",
+ "id": "e41c38bf",
"metadata": {
"editable": true
},
@@ -2457,7 +2460,7 @@
},
{
"cell_type": "markdown",
- "id": "b9fc9109",
+ "id": "fa1ca397",
"metadata": {
"editable": true
},
@@ -2470,7 +2473,7 @@
},
{
"cell_type": "markdown",
- "id": "9fb6b2b5",
+ "id": "320791d1",
"metadata": {
"editable": true
},
@@ -2490,7 +2493,7 @@
},
{
"cell_type": "markdown",
- "id": "00b0cdd3",
+ "id": "480ff354",
"metadata": {
"editable": true
},
@@ -2523,7 +2526,7 @@
},
{
"cell_type": "markdown",
- "id": "6bbe5eb6",
+ "id": "94619368",
"metadata": {
"editable": true
},
@@ -2535,7 +2538,7 @@
},
{
"cell_type": "markdown",
- "id": "955277a1",
+ "id": "388ff7f4",
"metadata": {
"editable": true
},
@@ -2554,7 +2557,7 @@
},
{
"cell_type": "markdown",
- "id": "85dbde51",
+ "id": "d9d7c987",
"metadata": {
"editable": true
},
@@ -2568,7 +2571,7 @@
},
{
"cell_type": "markdown",
- "id": "15a3f221",
+ "id": "8a3e33b4",
"metadata": {
"editable": true
},
@@ -2591,7 +2594,7 @@
},
{
"cell_type": "markdown",
- "id": "5da193b4",
+ "id": "30971d96",
"metadata": {
"editable": true
},
@@ -2610,7 +2613,7 @@
},
{
"cell_type": "markdown",
- "id": "1698ade8",
+ "id": "1471a891",
"metadata": {
"editable": true
},
@@ -2622,7 +2625,7 @@
},
{
"cell_type": "markdown",
- "id": "897ae188",
+ "id": "c0d00750",
"metadata": {
"editable": true
},
@@ -2632,7 +2635,7 @@
},
{
"cell_type": "markdown",
- "id": "ece1ed87",
+ "id": "05c9d4ee",
"metadata": {
"editable": true
},
@@ -2644,7 +2647,7 @@
},
{
"cell_type": "markdown",
- "id": "417a7ba7",
+ "id": "1406fbbe",
"metadata": {
"editable": true
},
@@ -2661,7 +2664,7 @@
{
"cell_type": "code",
"execution_count": 20,
- "id": "5ec3241b",
+ "id": "65d6a383",
"metadata": {
"collapsed": false,
"editable": true
@@ -2743,7 +2746,7 @@
},
{
"cell_type": "markdown",
- "id": "97f15041",
+ "id": "9f0fe103",
"metadata": {
"editable": true
},
@@ -2781,7 +2784,7 @@
},
{
"cell_type": "markdown",
- "id": "f3fa1b4e",
+ "id": "d8ec7ed4",
"metadata": {
"editable": true
},
@@ -2811,7 +2814,7 @@
},
{
"cell_type": "markdown",
- "id": "21e86c9d",
+ "id": "9a8b3d4b",
"metadata": {
"editable": true
},
@@ -2832,7 +2835,7 @@
},
{
"cell_type": "markdown",
- "id": "e772cdce",
+ "id": "21e1e7a1",
"metadata": {
"editable": true
},
@@ -2844,7 +2847,7 @@
},
{
"cell_type": "markdown",
- "id": "698958e9",
+ "id": "100a1461",
"metadata": {
"editable": true
},
@@ -2859,7 +2862,7 @@
},
{
"cell_type": "markdown",
- "id": "a28d2d91",
+ "id": "fcc4eef2",
"metadata": {
"editable": true
},
@@ -2876,7 +2879,7 @@
},
{
"cell_type": "markdown",
- "id": "d166896b",
+ "id": "a25f726d",
"metadata": {
"editable": true
},
@@ -2888,7 +2891,7 @@
},
{
"cell_type": "markdown",
- "id": "83d8a52c",
+ "id": "0d98d20e",
"metadata": {
"editable": true
},
@@ -2901,7 +2904,7 @@
},
{
"cell_type": "markdown",
- "id": "9043e67e",
+ "id": "2f4c366c",
"metadata": {
"editable": true
},
@@ -2913,7 +2916,7 @@
},
{
"cell_type": "markdown",
- "id": "38ef410a",
+ "id": "6dd7c96e",
"metadata": {
"editable": true
},
@@ -2927,7 +2930,7 @@
},
{
"cell_type": "markdown",
- "id": "05b1fa07",
+ "id": "a513b6e5",
"metadata": {
"editable": true
},
@@ -2939,7 +2942,7 @@
},
{
"cell_type": "markdown",
- "id": "9038c068",
+ "id": "2af99fb5",
"metadata": {
"editable": true
},
@@ -2951,7 +2954,7 @@
},
{
"cell_type": "markdown",
- "id": "a87dd367",
+ "id": "988f1325",
"metadata": {
"editable": true
},
@@ -2963,7 +2966,7 @@
},
{
"cell_type": "markdown",
- "id": "c0e44d26",
+ "id": "ccd7f26c",
"metadata": {
"editable": true
},
@@ -2973,7 +2976,7 @@
},
{
"cell_type": "markdown",
- "id": "6fe053b3",
+ "id": "12e11580",
"metadata": {
"editable": true
},
@@ -2985,7 +2988,7 @@
},
{
"cell_type": "markdown",
- "id": "ab2ee7cb",
+ "id": "1e70b838",
"metadata": {
"editable": true
},
@@ -2995,7 +2998,7 @@
},
{
"cell_type": "markdown",
- "id": "8eb8e72c",
+ "id": "1edf7ab2",
"metadata": {
"editable": true
},
@@ -3007,7 +3010,7 @@
},
{
"cell_type": "markdown",
- "id": "eaa9d407",
+ "id": "d36fd2da",
"metadata": {
"editable": true
},
@@ -3021,7 +3024,7 @@
},
{
"cell_type": "markdown",
- "id": "020c12af",
+ "id": "4ee56ad9",
"metadata": {
"editable": true
},
@@ -3033,7 +3036,7 @@
},
{
"cell_type": "markdown",
- "id": "14cfc5fa",
+ "id": "160efabd",
"metadata": {
"editable": true
},
@@ -3043,7 +3046,7 @@
},
{
"cell_type": "markdown",
- "id": "c3c665c2",
+ "id": "cab136bb",
"metadata": {
"editable": true
},
@@ -3055,7 +3058,7 @@
},
{
"cell_type": "markdown",
- "id": "553452a0",
+ "id": "217ca399",
"metadata": {
"editable": true
},
@@ -3065,7 +3068,7 @@
},
{
"cell_type": "markdown",
- "id": "c23c4b45",
+ "id": "63747f21",
"metadata": {
"editable": true
},
@@ -3077,7 +3080,7 @@
},
{
"cell_type": "markdown",
- "id": "f3e24109",
+ "id": "54d3e3e3",
"metadata": {
"editable": true
},
@@ -3089,7 +3092,7 @@
},
{
"cell_type": "markdown",
- "id": "99e69f17",
+ "id": "f6ec4ea3",
"metadata": {
"editable": true
},
@@ -3101,7 +3104,7 @@
},
{
"cell_type": "markdown",
- "id": "d0413cbf",
+ "id": "1f48793d",
"metadata": {
"editable": true
},
@@ -3111,7 +3114,7 @@
},
{
"cell_type": "markdown",
- "id": "243c6e25",
+ "id": "e340e6d7",
"metadata": {
"editable": true
},
@@ -3123,7 +3126,7 @@
},
{
"cell_type": "markdown",
- "id": "cdf0babe",
+ "id": "ba026ba1",
"metadata": {
"editable": true
},
@@ -3133,7 +3136,7 @@
},
{
"cell_type": "markdown",
- "id": "d332ef89",
+ "id": "836235e1",
"metadata": {
"editable": true
},
@@ -3145,7 +3148,7 @@
},
{
"cell_type": "markdown",
- "id": "6dee62e2",
+ "id": "4c7e35e8",
"metadata": {
"editable": true
},
@@ -3169,7 +3172,7 @@
},
{
"cell_type": "markdown",
- "id": "e6b1b7c2",
+ "id": "5e17d297",
"metadata": {
"editable": true
},
@@ -3181,7 +3184,7 @@
},
{
"cell_type": "markdown",
- "id": "25fa99aa",
+ "id": "90a264a8",
"metadata": {
"editable": true
},
@@ -3191,7 +3194,7 @@
},
{
"cell_type": "markdown",
- "id": "2f20e502",
+ "id": "9c45cadd",
"metadata": {
"editable": true
},
@@ -3203,7 +3206,7 @@
},
{
"cell_type": "markdown",
- "id": "40c1ebc1",
+ "id": "a02fe84e",
"metadata": {
"editable": true
},
@@ -3215,7 +3218,7 @@
},
{
"cell_type": "markdown",
- "id": "932d51af",
+ "id": "1123e58e",
"metadata": {
"editable": true
},
@@ -3227,7 +3230,7 @@
},
{
"cell_type": "markdown",
- "id": "6ac07ae0",
+ "id": "b93e2324",
"metadata": {
"editable": true
},
@@ -3237,7 +3240,7 @@
},
{
"cell_type": "markdown",
- "id": "8f9b3b42",
+ "id": "c8c7b816",
"metadata": {
"editable": true
},
@@ -3249,7 +3252,7 @@
},
{
"cell_type": "markdown",
- "id": "ba4701b4",
+ "id": "e185ca0a",
"metadata": {
"editable": true
},
@@ -3259,7 +3262,7 @@
},
{
"cell_type": "markdown",
- "id": "9f3dd13f",
+ "id": "6087b111",
"metadata": {
"editable": true
},
@@ -3273,7 +3276,7 @@
},
{
"cell_type": "markdown",
- "id": "f46643d3",
+ "id": "20fc7314",
"metadata": {
"editable": true
},
@@ -3291,7 +3294,7 @@
},
{
"cell_type": "markdown",
- "id": "72c17c61",
+ "id": "cc682107",
"metadata": {
"editable": true
},
@@ -3301,7 +3304,7 @@
},
{
"cell_type": "markdown",
- "id": "4a4b9cd6",
+ "id": "e048bf4d",
"metadata": {
"editable": true
},
@@ -3319,7 +3322,7 @@
},
{
"cell_type": "markdown",
- "id": "660de22f",
+ "id": "6f55d291",
"metadata": {
"editable": true
},
@@ -3329,7 +3332,7 @@
},
{
"cell_type": "markdown",
- "id": "d91e1536",
+ "id": "edd966f8",
"metadata": {
"editable": true
},
@@ -3347,7 +3350,7 @@
},
{
"cell_type": "markdown",
- "id": "28b057da",
+ "id": "d6fe086b",
"metadata": {
"editable": true
},
@@ -3374,7 +3377,7 @@
},
{
"cell_type": "markdown",
- "id": "cbee200c",
+ "id": "9541d79b",
"metadata": {
"editable": true
},
@@ -3386,7 +3389,7 @@
},
{
"cell_type": "markdown",
- "id": "cfd8e707",
+ "id": "cba8762c",
"metadata": {
"editable": true
},
@@ -3398,7 +3401,7 @@
},
{
"cell_type": "markdown",
- "id": "9c059e74",
+ "id": "4b26de68",
"metadata": {
"editable": true
},
@@ -3408,7 +3411,7 @@
},
{
"cell_type": "markdown",
- "id": "87b9c575",
+ "id": "20c4375e",
"metadata": {
"editable": true
},
@@ -3420,7 +3423,7 @@
},
{
"cell_type": "markdown",
- "id": "9417f6ec",
+ "id": "be1ed1e5",
"metadata": {
"editable": true
},
@@ -3430,7 +3433,7 @@
},
{
"cell_type": "markdown",
- "id": "07278244",
+ "id": "261bb8b0",
"metadata": {
"editable": true
},
@@ -3442,7 +3445,7 @@
},
{
"cell_type": "markdown",
- "id": "3d2ebc91",
+ "id": "f4f6f49c",
"metadata": {
"editable": true
},
@@ -3452,7 +3455,7 @@
},
{
"cell_type": "markdown",
- "id": "68aee93b",
+ "id": "cc0d0da1",
"metadata": {
"editable": true
},
@@ -3464,7 +3467,7 @@
},
{
"cell_type": "markdown",
- "id": "a65994f4",
+ "id": "b9b6d15f",
"metadata": {
"editable": true
},
@@ -3476,7 +3479,7 @@
},
{
"cell_type": "markdown",
- "id": "d86a2149",
+ "id": "844d96b5",
"metadata": {
"editable": true
},
@@ -3499,7 +3502,7 @@
},
{
"cell_type": "markdown",
- "id": "f18e1be4",
+ "id": "8ace79d2",
"metadata": {
"editable": true
},
@@ -3511,7 +3514,7 @@
},
{
"cell_type": "markdown",
- "id": "61435fe1",
+ "id": "6b086fb0",
"metadata": {
"editable": true
},
@@ -3521,7 +3524,7 @@
},
{
"cell_type": "markdown",
- "id": "bbf8110f",
+ "id": "8c88ee52",
"metadata": {
"editable": true
},
@@ -3533,7 +3536,7 @@
},
{
"cell_type": "markdown",
- "id": "3a518090",
+ "id": "bbe2623b",
"metadata": {
"editable": true
},
@@ -3543,7 +3546,7 @@
},
{
"cell_type": "markdown",
- "id": "85824270",
+ "id": "dce58ee6",
"metadata": {
"editable": true
},
@@ -3555,7 +3558,7 @@
},
{
"cell_type": "markdown",
- "id": "815818ed",
+ "id": "6b18fdf9",
"metadata": {
"editable": true
},
@@ -3567,7 +3570,7 @@
},
{
"cell_type": "markdown",
- "id": "fda6b470",
+ "id": "8714fbd1",
"metadata": {
"editable": true
},
diff --git a/doc/src/week40/week40.do.txt b/doc/src/week40/week40.do.txt
index ba7cf4a32..1829183b4 100644
--- a/doc/src/week40/week40.do.txt
+++ b/doc/src/week40/week40.do.txt
@@ -231,28 +231,28 @@ We note that we have defined several hyperparameters. These are now the number o
!bc pycod
# Importing various packages
+# Importing various packages
from math import exp, sqrt
from random import random, seed
import numpy as np
import matplotlib.pyplot as plt
-from sklearn.linear_model import SGDRegressor
-n = 1000
+n = 100
x = 2*np.random.rand(n,1)
y = 4+3*x+np.random.randn(n,1)
X = np.c_[np.ones((n,1)), x]
+XT_X = X.T @ X
theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
print("Own inversion")
print(theta_linreg)
-sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
-sgdreg.fit(x,y.ravel())
-print("sgdreg from scikit")
-print(sgdreg.intercept_, sgdreg.coef_)
-
+# Hessian matrix
+H = (2.0/n)* XT_X
+EigValues, EigVectors = np.linalg.eig(H)
+print(f"Eigenvalues of Hessian Matrix:{EigValues}")
theta = np.random.randn(2,1)
-eta = 0.1
+eta = 1.0/np.max(EigValues)
Niterations = 1000
@@ -267,7 +267,6 @@ Xnew = np.c_[np.ones((2,1)), xnew]
ypredict = Xnew.dot(theta)
ypredict2 = Xnew.dot(theta_linreg)
-
n_epochs = 50
M = 5 #size of each minibatch
m = int(n/M) #number of minibatches
@@ -278,16 +277,20 @@ def learning_schedule(t):
theta = np.random.randn(2,1)
for epoch in range(n_epochs):
+# Can you figure out a better way of setting up the contributions to each batch?
for i in range(m):
random_index = np.random.randint(m)
- xi = X[random_index:random_index+m]
- yi = y[random_index:random_index+m]
- gradients = 2.0* xi.T @ ((xi @ theta)-yi)
+ xi = X[random_index*M:random_index*M+M]
+ yi = y[random_index*M:random_index*M+M]
+ gradients = (2.0/M)* xi.T @ ((xi @ theta)-yi)
eta = learning_schedule(epoch*m+i)
theta = theta - eta*gradients
print("theta from own sdg")
print(theta)
+
+
+
plt.plot(xnew, ypredict, "r-")
plt.plot(xnew, ypredict2, "b-")
plt.plot(x, y ,'ro')