diff --git a/doc/pub/week48/html/._week48-bs006.html b/doc/pub/week48/html/._week48-bs006.html index 5a086a8d8..703810d96 100644 --- a/doc/pub/week48/html/._week48-bs006.html +++ b/doc/pub/week48/html/._week48-bs006.html @@ -261,9 +261,9 @@ MathJax.Hub.Config({
-Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables) +Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables). We define a vector \( \boldsymbol{x}_i=[x_i,y_i] \) and have $$ -z = \phi(x_i) =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). +\boldsymbol{z}_i = \phi(\boldsymbol{x}_i)^T =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). $$
@@ -291,10 +291,10 @@ $$
We note that this dot product can be rewritten as $$ -K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}^T\boldsymbol{x}']^d, +K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}_i^T\boldsymbol{x}_j]^d, $$ -where \( d=2 \) in our case and \( \boldsymbol{x}=[x_i,y_i] \) and \( \boldsymbol{x}=[x_j,y_j] \). +where \( d=2 \) in our case and \( \boldsymbol{x}_i=[x_i,y_i] \) and \( \boldsymbol{x}_j=[x_j,y_j] \). To compute the last equation is however inefficient from a computational stand. Instead of computing the last equation for the kernel, we simply compute the dot product \( (\boldsymbol{x}_i^T\boldsymbol{x}_j)^2 \). diff --git a/doc/pub/week48/html/._week48-bs015.html b/doc/pub/week48/html/._week48-bs015.html index fa35d4a8c..2f2a0ee84 100644 --- a/doc/pub/week48/html/._week48-bs015.html +++ b/doc/pub/week48/html/._week48-bs015.html @@ -273,14 +273,11 @@ $$
diff --git a/doc/pub/week48/html/week48-reveal.html b/doc/pub/week48/html/week48-reveal.html index ebcfa4cd8..7bdb8c9c1 100644 --- a/doc/pub/week48/html/week48-reveal.html +++ b/doc/pub/week48/html/week48-reveal.html @@ -294,10 +294,10 @@ plt.show()
-Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables) +Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables). We define a vector \( \boldsymbol{x}_i=[x_i,y_i] \) and have
$$
-z = \phi(x_i) =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right).
+\boldsymbol{z}_i = \phi(\boldsymbol{x}_i)^T =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right).
$$
@@ -335,11 +335,11 @@ $$
We note that this dot product can be rewritten as
$$
-K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}^T\boldsymbol{x}']^d,
+K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}_i^T\boldsymbol{x}_j]^d,
$$
-where \( d=2 \) in our case and \( \boldsymbol{x}=[x_i,y_i] \) and \( \boldsymbol{x}=[x_j,y_j] \).
+where \( d=2 \) in our case and \( \boldsymbol{x}_i=[x_i,y_i] \) and \( \boldsymbol{x}_j=[x_j,y_j] \).
To compute the last equation is however inefficient from a computational stand.
Instead of computing the last equation for the kernel, we simply compute
the dot product \( (\boldsymbol{x}_i^T\boldsymbol{x}_j)^2 \).
@@ -809,13 +809,10 @@ $$
- -\( 0\leq \lambda_i \) and \( \lambda_i \leq C \). These two inequalities define then the matrix \( \boldsymbol{G} \) and the vector \( \boldsymbol{h} \). @@ -833,18 +830,18 @@ $$ 0& 0 & -1 & \dots & 0 \\ \dots& \dots & \dots & \dots & \dots \\ 0& 0 & 0 & \dots & -1 \\ - -& 0 & 0 & \dots & 0 \\ +1 & 0 & 0 & \dots & 0 \\ 0& 1 & 0 & \dots & 0 \\ 0& 0 & 1 & \dots & 0 \\ \dots& \dots & \dots & \dots & \dots \\ 0& 0 & 0 & \dots & 1 \\ -\end{bmatrix}\boldsymbol{\lambda} +\end{bmatrix} \begin{bmatrix} \lambda_1 \\ \lambda_2 \\ \lambda_3 \\ \dots \\ \lambda_n \\ -\end{bmatrix}\boldsymbol{\lambda}= +\end{bmatrix}= \begin{bmatrix} 0 \\ 0 \\ 0 \\ @@ -855,7 +852,7 @@ C \\ C \\ \dots \\ C \\ -\end{bmatrix}\boldsymbol{\lambda} +\end{bmatrix}. $$
diff --git a/doc/pub/week48/html/week48-solarized.html b/doc/pub/week48/html/week48-solarized.html
index 873e0e3b9..026699991 100644
--- a/doc/pub/week48/html/week48-solarized.html
+++ b/doc/pub/week48/html/week48-solarized.html
@@ -342,9 +342,9 @@ plt.show()
-Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables) +Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables). We define a vector \( \boldsymbol{x}_i=[x_i,y_i] \) and have $$ -z = \phi(x_i) =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). +\boldsymbol{z}_i = \phi(\boldsymbol{x}_i)^T =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). $$
@@ -372,10 +372,10 @@ $$
We note that this dot product can be rewritten as $$ -K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}^T\boldsymbol{x}']^d, +K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}_i^T\boldsymbol{x}_j]^d, $$ -where \( d=2 \) in our case and \( \boldsymbol{x}=[x_i,y_i] \) and \( \boldsymbol{x}=[x_j,y_j] \). +where \( d=2 \) in our case and \( \boldsymbol{x}_i=[x_i,y_i] \) and \( \boldsymbol{x}_j=[x_j,y_j] \). To compute the last equation is however inefficient from a computational stand. Instead of computing the last equation for the kernel, we simply compute the dot product \( (\boldsymbol{x}_i^T\boldsymbol{x}_j)^2 \). @@ -816,14 +816,11 @@ $$
diff --git a/doc/pub/week48/html/week48.html b/doc/pub/week48/html/week48.html index 2b26fdf3d..be0846702 100644 --- a/doc/pub/week48/html/week48.html +++ b/doc/pub/week48/html/week48.html @@ -347,9 +347,9 @@ plt.show()
-Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables) +Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with \( x_i \) and \( y_i \) as variables). We define a vector \( \boldsymbol{x}_i=[x_i,y_i] \) and have $$ -z = \phi(x_i) =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). +\boldsymbol{z}_i = \phi(\boldsymbol{x}_i)^T =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). $$
@@ -377,10 +377,10 @@ $$
We note that this dot product can be rewritten as $$ -K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}^T\boldsymbol{x}']^d, +K(\boldsymbol{x}_i,\boldsymbol{x}_j)=[1+\boldsymbol{x}_i^T\boldsymbol{x}_j]^d, $$ -where \( d=2 \) in our case and \( \boldsymbol{x}=[x_i,y_i] \) and \( \boldsymbol{x}=[x_j,y_j] \). +where \( d=2 \) in our case and \( \boldsymbol{x}_i=[x_i,y_i] \) and \( \boldsymbol{x}_j=[x_j,y_j] \). To compute the last equation is however inefficient from a computational stand. Instead of computing the last equation for the kernel, we simply compute the dot product \( (\boldsymbol{x}_i^T\boldsymbol{x}_j)^2 \). @@ -821,14 +821,11 @@ $$
diff --git a/doc/pub/week48/ipynb/ipynb-week48-src.tar.gz b/doc/pub/week48/ipynb/ipynb-week48-src.tar.gz index 3adffd050..f1c2daebe 100644 Binary files a/doc/pub/week48/ipynb/ipynb-week48-src.tar.gz and b/doc/pub/week48/ipynb/ipynb-week48-src.tar.gz differ diff --git a/doc/pub/week48/ipynb/week48.ipynb b/doc/pub/week48/ipynb/week48.ipynb index 65b1ea189..5dd1f2f42 100644 --- a/doc/pub/week48/ipynb/week48.ipynb +++ b/doc/pub/week48/ipynb/week48.ipynb @@ -138,7 +138,7 @@ "source": [ "## The equations\n", "\n", - "Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with $x_i$ and $y_i$ as variables)" + "Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with $x_i$ and $y_i$ as variables). We define a vector $\\boldsymbol{x}_i=[x_i,y_i]$ and have" ] }, { @@ -146,7 +146,7 @@ "metadata": {}, "source": [ "$$\n", - "z = \\phi(x_i) =\\left(1, \\sqrt{2}x_i, \\sqrt{2}y_i, x_i^2, y_i^2, \\sqrt{2}x_iy_i\\right).\n", + "\\boldsymbol{z}_i = \\phi(\\boldsymbol{x}_i)^T =\\left(1, \\sqrt{2}x_i, \\sqrt{2}y_i, x_i^2, y_i^2, \\sqrt{2}x_iy_i\\right).\n", "$$" ] }, @@ -227,7 +227,7 @@ "metadata": {}, "source": [ "$$\n", - "K(\\boldsymbol{x}_i,\\boldsymbol{x}_j)=[1+\\boldsymbol{x}^T\\boldsymbol{x}']^d,\n", + "K(\\boldsymbol{x}_i,\\boldsymbol{x}_j)=[1+\\boldsymbol{x}_i^T\\boldsymbol{x}_j]^d,\n", "$$" ] }, @@ -235,7 +235,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "where $d=2$ in our case and $\\boldsymbol{x}=[x_i,y_i]$ and $\\boldsymbol{x}=[x_j,y_j]$.\n", + "where $d=2$ in our case and $\\boldsymbol{x}_i=[x_i,y_i]$ and $\\boldsymbol{x}_j=[x_j,y_j]$.\n", "To compute the last equation is however inefficient from a computational stand.\n", "Instead of computing the last equation for the kernel, we simply compute\n", "the dot product $(\\boldsymbol{x}_i^T\\boldsymbol{x}_j)^2$.\n", @@ -815,13 +815,11 @@ "\n", "2. The matrix $\\boldsymbol{P}$ has matrix elements $p_{ij}=y_iy_jK(\\boldsymbol{x}_i,\\boldsymbol{x}_j)$. Given a kernel $K$ and the targets $y_i$ this matrix is easy to set up.\n", "\n", - "3. The $\\boldsymbol{q}$ is zero.\n", + "3. The vector $\\boldsymbol{q}$ is zero.\n", "\n", "4. The constraint $\\boldsymbol{y}^T\\boldsymbol{\\lambda}=0$ leads to $f=0$ and $\\boldsymbol{A}=\\boldsymbol{y}$.\n", "\n", - "5. To set up the matrix $\\boldsymbol{G}$ we note that the inequalities $0\\leq \\lambda_i \\leq C$ can be split up into\n", - "\n", - "$0\\leq \\lambda_i$ and $\\lambda_i \\leq C$. These two inequalities define then the matrix $\\boldsymbol{G}$ and the vector $\\boldsymbol{h}$.\n", + "5. To set up the matrix $\\boldsymbol{G}$ we note that the inequalities $0\\leq \\lambda_i \\leq C$ can be split up into $0\\leq \\lambda_i$ and $\\lambda_i \\leq C$. These two inequalities define then the matrix $\\boldsymbol{G}$ and the vector $\\boldsymbol{h}$.\n", "\n", "## Setting up $\\boldsymbol{G}\\boldsymbol{\\lambda} \\preceq \\boldsymbol{h}$\n", "\n", @@ -840,18 +838,18 @@ "0& 0 & -1 & \\dots & 0 \\\\\n", "\\dots& \\dots & \\dots & \\dots & \\dots \\\\\n", "0& 0 & 0 & \\dots & -1 \\\\\n", - " -& 0 & 0 & \\dots & 0 \\\\\n", + "1 & 0 & 0 & \\dots & 0 \\\\\n", "0& 1 & 0 & \\dots & 0 \\\\\n", "0& 0 & 1 & \\dots & 0 \\\\\n", "\\dots& \\dots & \\dots & \\dots & \\dots \\\\\n", "0& 0 & 0 & \\dots & 1 \\\\\n", - "\\end{bmatrix}\\boldsymbol{\\lambda}\n", + "\\end{bmatrix}\n", "\\begin{bmatrix} \\lambda_1 \\\\\n", "\\lambda_2 \\\\\n", "\\lambda_3 \\\\\n", "\\dots \\\\\n", "\\lambda_n \\\\\n", - "\\end{bmatrix}\\boldsymbol{\\lambda}=\n", + "\\end{bmatrix}=\n", "\\begin{bmatrix} 0 \\\\\n", "0 \\\\\n", "0 \\\\\n", @@ -862,7 +860,7 @@ "C \\\\\n", "\\dots \\\\\n", "C \\\\\n", - "\\end{bmatrix}\\boldsymbol{\\lambda}\n", + "\\end{bmatrix}.\n", "$$" ] }, diff --git a/doc/src/week48/week48.do.txt b/doc/src/week48/week48.do.txt index 3209ff18b..3f1006fe2 100644 --- a/doc/src/week48/week48.do.txt +++ b/doc/src/week48/week48.do.txt @@ -119,10 +119,10 @@ plt.show() !split ===== The equations ===== -Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with $x_i$ and $y_i$ as variables) +Suppose we define a polynomial transformation of degree two only (we continue to live in a plane with $x_i$ and $y_i$ as variables). We define a vector $\bm{x}_i=[x_i,y_i]$ and have !bt \[ -z = \phi(x_i) =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). +\bm{z}_i = \phi(\bm{x}_i)^T =\left(1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i\right). \] !et @@ -155,10 +155,10 @@ K(\bm{x}_i,\bm{x}_j)=[1, \sqrt{2}x_i, \sqrt{2}y_i, x_i^2, y_i^2, \sqrt{2}x_iy_i] We note that this dot product can be rewritten as !bt \[ -K(\bm{x}_i,\bm{x}_j)=[1+\bm{x}^T\bm{x}']^d, +K(\bm{x}_i,\bm{x}_j)=[1+\bm{x}_i^T\bm{x}_j]^d, \] !et -where $d=2$ in our case and $\bm{x}=[x_i,y_i]$ and $\bm{x}=[x_j,y_j]$. +where $d=2$ in our case and $\bm{x}_i=[x_i,y_i]$ and $\bm{x}_j=[x_j,y_j]$. To compute the last equation is however inefficient from a computational stand. Instead of computing the last equation for the kernel, we simply compute the dot product $(\bm{x}_i^T\bm{x}_j)^2$. @@ -574,10 +574,9 @@ We have the general problem o With a given kernel we can thus define the matrix $\bm{P}$. o The matrix $\bm{P}$ has matrix elements $p_{ij}=y_iy_jK(\bm{x}_i,\bm{x}_j)$. Given a kernel $K$ and the targets $y_i$ this matrix is easy to set up. -o The $\bm{q}$ is zero. +o The vector $\bm{q}$ is zero. o The constraint $\bm{y}^T\bm{\lambda}=0$ leads to $f=0$ and $\bm{A}=\bm{y}$. -o To set up the matrix $\bm{G}$ we note that the inequalities $0\leq \lambda_i \leq C$ can be split up into -$0\leq \lambda_i$ and $\lambda_i \leq C$. These two inequalities define then the matrix $\bm{G}$ and the vector $\bm{h}$. +o To set up the matrix $\bm{G}$ we note that the inequalities $0\leq \lambda_i \leq C$ can be split up into $0\leq \lambda_i$ and $\lambda_i \leq C$. These two inequalities define then the matrix $\bm{G}$ and the vector $\bm{h}$. !split ===== Setting up $\bm{G}\bm{\lambda} \preceq \bm{h}$ ===== @@ -592,18 +591,18 @@ can be written as 0& 0 & -1 & \dots & 0 \\ \dots& \dots & \dots & \dots & \dots \\ 0& 0 & 0 & \dots & -1 \\ - -& 0 & 0 & \dots & 0 \\ +1 & 0 & 0 & \dots & 0 \\ 0& 1 & 0 & \dots & 0 \\ 0& 0 & 1 & \dots & 0 \\ \dots& \dots & \dots & \dots & \dots \\ 0& 0 & 0 & \dots & 1 \\ -\end{bmatrix}\bm{\lambda} +\end{bmatrix} \begin{bmatrix} \lambda_1 \\ \lambda_2 \\ \lambda_3 \\ \dots \\ \lambda_n \\ -\end{bmatrix}\bm{\lambda}= +\end{bmatrix}= \begin{bmatrix} 0 \\ 0 \\ 0 \\ @@ -614,7 +613,7 @@ C \\ C \\ \dots \\ C \\ -\end{bmatrix}\bm{\lambda} +\end{bmatrix}. \] !et