From 03084febf32cd526e7102afefceb60647e3090ce Mon Sep 17 00:00:00 2001 From: Morten Hjorth-Jensen Date: Thu, 30 Sep 2021 10:47:41 +0200 Subject: [PATCH] typo corrections --- doc/pub/week39/html/week39-reveal.html | 10 ++++++---- doc/pub/week39/html/week39-solarized.html | 11 +++++++---- doc/pub/week39/html/week39.html | 11 +++++++---- doc/pub/week39/ipynb/ipynb-week39-src.tar.gz | Bin 192 -> 193 bytes doc/pub/week39/ipynb/week39.ipynb | 10 ++++++---- doc/src/week39/week39.do.txt | 10 ++++++---- 6 files changed, 32 insertions(+), 20 deletions(-) diff --git a/doc/pub/week39/html/week39-reveal.html b/doc/pub/week39/html/week39-reveal.html index a802dee73..6a4b2f801 100644 --- a/doc/pub/week39/html/week39-reveal.html +++ b/doc/pub/week39/html/week39-reveal.html @@ -1028,15 +1028,15 @@ $$ from mpl_toolkits.mplot3d import axes3d def f(x): - return 0.5*x[0]**2 + 2.5*x[1]**2 + return x[0]**2 + 3.0*x[1]**2 def df(x): - return np.array([x[0], 5*x[1]]) + return np.array([2*x[0], 6*x[1]]) fig = pt.figure() ax = fig.gca(projection="3d") -xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j] +xmesh, ymesh = np.mgrid[-3:3:50j,-3:3:50j] fmesh = f(np.array([xmesh, ymesh])) ax.plot_surface(xmesh, ymesh, fmesh) @@ -1080,6 +1080,8 @@ pt.contour(xmesh, ymesh, fmesh, 50) it_array = np.array(guesses) pt.plot(it_array.T[0], it_array.T[1], "x-") +

+Note that we did only one iteration here. We can easily add more using our previous guesses. @@ -1502,7 +1504,7 @@ X = np.c_[np.ones((n,1)), x] H = (2.0/n)* X.T @ X # Get the eigenvalues EigValues, EigVectors = np.linalg.eig(H) -print(EigValues) +print(f"Eigenvalues of Hessian Matrix:{EigValues}") beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y print(beta_linreg) diff --git a/doc/pub/week39/html/week39-solarized.html b/doc/pub/week39/html/week39-solarized.html index 7d4f92047..2b2180abc 100644 --- a/doc/pub/week39/html/week39-solarized.html +++ b/doc/pub/week39/html/week39-solarized.html @@ -1057,15 +1057,15 @@ $$ from mpl_toolkits.mplot3d import axes3d def f(x): - return 0.5*x[0]**2 + 2.5*x[1]**2 + return x[0]**2 + 3.0*x[1]**2 def df(x): - return np.array([x[0], 5*x[1]]) + return np.array([2*x[0], 6*x[1]]) fig = pt.figure() ax = fig.gca(projection="3d") -xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j] +xmesh, ymesh = np.mgrid[-3:3:50j,-3:3:50j] fmesh = f(np.array([xmesh, ymesh])) ax.plot_surface(xmesh, ymesh, fmesh) @@ -1109,6 +1109,9 @@ pt.contour(xmesh, ymesh, fmesh, 50) it_array = np.array(guesses) pt.plot(it_array.T[0], it_array.T[1], "x-") +

+Note that we did only one iteration here. We can easily add more using our previous guesses. +











@@ -1489,7 +1492,7 @@ X = np.c_[np.ones((n,1)), x] H = (2.0/n)* X.T @ X # Get the eigenvalues EigValues, EigVectors = np.linalg.eig(H) -print(EigValues) +print(f"Eigenvalues of Hessian Matrix:{EigValues}") beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y print(beta_linreg) diff --git a/doc/pub/week39/html/week39.html b/doc/pub/week39/html/week39.html index 7040e016f..faaccd860 100644 --- a/doc/pub/week39/html/week39.html +++ b/doc/pub/week39/html/week39.html @@ -1062,15 +1062,15 @@ $$ from mpl_toolkits.mplot3d import axes3d def f(x): - return 0.5*x[0]**2 + 2.5*x[1]**2 + return x[0]**2 + 3.0*x[1]**2 def df(x): - return np.array([x[0], 5*x[1]]) + return np.array([2*x[0], 6*x[1]]) fig = pt.figure() ax = fig.gca(projection="3d") -xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j] +xmesh, ymesh = np.mgrid[-3:3:50j,-3:3:50j] fmesh = f(np.array([xmesh, ymesh])) ax.plot_surface(xmesh, ymesh, fmesh) @@ -1114,6 +1114,9 @@ pt.contour(xmesh, ymesh, fmesh, = np.array(guesses) pt.plot(it_array.T[0], it_array.T[1], "x-") +

+Note that we did only one iteration here. We can easily add more using our previous guesses. +











@@ -1494,7 +1497,7 @@ X = np.c H = (2.0/n)* X.T @ X # Get the eigenvalues EigValues, EigVectors = np.linalg.eig(H) -print(EigValues) +print(f"Eigenvalues of Hessian Matrix:{EigValues}") beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y print(beta_linreg) diff --git a/doc/pub/week39/ipynb/ipynb-week39-src.tar.gz b/doc/pub/week39/ipynb/ipynb-week39-src.tar.gz index 428b7dd95c2c23c9ccdc43ab20084f957a0d632d..a241d058b7eba7f817abb7d4fed37bbc80434eed 100644 GIT binary patch literal 193 zcmV;y06za8iwFRsc~xNm1MSaC3c@fD2H>uHia9|^(xk7a~5igL^)W+JRCMnw6 z+Xv`MaZ^OdxA_@n7-kOHdb7(ScXz>J5JCy1FlL&tDG{0L3C0XC#e|WRCX@ieF^fq6 zXt|SKI_tO@PHC#MP*$jSbHi9!e%Ld=0?+&t$4Xk*?t52h1xh=SYhA-lh&o7jUsTIG3tZ~e2#1z00;m845L*m literal 192 zcmV;x06+g9iwFS9byZ;i1MSaC3c@fD2H>uHia9|^(ibiTyKo_hc!88oZLCddlA^u6 zeSoeMH${Yeo1bBZVdjvnH@hsbck3;N5Rya@jF~3!l!VRogwhyjL|M#ImQn_UhA~S# zAj_Tf(izM3a7t61Q5ux*=7zDd{IF+!1)ljQj+HR5-S@Uq5~Q-2D^