8000 更新Chapter 3 · tao-to-python/Learning-from-data@8040e5a · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /div>

Commit 8040e5a

Browse files
committed
更新Chapter 3
1 parent 527145d commit 8040e5a

File tree

85 files changed

+4145
-7194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+4145
-7194
lines changed
10.9 KB
Binary file not shown.

Chapter1/md/Chapter 1 The Learning Problem.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -736,14 +736,14 @@ plt.show()
736736

737737
Prove that the PLA eventually converges to a linear separator for separable data. The following steps will guide you through the proof. Let $w^*$ be an optimal set of weights (one which separates the data).The essential idea in this proof is to show that the PLA weights $w(t$) get "more aligned" with $w^*$ with every iteration . For simplicity, assume that $w(0) = 0$.
738738

739-
(a) Let $\rho = {\min}_{1\le n\le N} y_n(w^{*T} x_n )$ . Show that $\rho > 0$.
739+
(a) Let $\rho = {\min}_{1\le n\le N} y_n(w^{*T} x_n )$ . Show that $\rho > 0$.
740740

741-
(b) Show that $w^T (t)w^*\ge w^T(t- 1)w^*+\rho$, and conclude that $w^T(t)w^* \ge t\rho$.[Hint: Use induction.]
741+
(b) Show that $w^T (t)w^*\ge w^T(t- 1)w^*+\rho$, and conclude that $w^T(t)w^* \ge t\rho$.[Hint: Use induction.]
742742

743743
(c) Show that $||w (t) ||^2 \le ||w(t - 1) ||^2 + ||x(t - 1) ||^2.​$
744744
[Hint: $y(t - 1) · (w^T(t - l)x(t - 1)) \le 0​$ because $x(t - 1)​$ was misclassified by $w (t - 1 )​$].
745745

746-
(d) Show by induction that $||w(t) ||^2 \le tR^2$ , where$ R = {\max}_{1\le n\le N} ||xn ||$ ·
746+
(d) Show by induction that $||w(t) ||^2 \le tR^2$ , where$ R = {\max}_{1\le n\le N} ||xn ||$ ·
747747

748748
(e) Using (b) and (d), show that
749749
$$
@@ -756,7 +756,7 @@ $$
756756
[Hint: $\frac {w (t)w^*} {||w(t)||\ ||w^*||}\le 1​$ . Why?]
757757
In practice, PLA converges more quickly than the bound $\frac {R^2||w^*||^2} {\rho^2}​$ suggests.Nevertheless, because we do not know $\rho​$ in advance, we can 't determine the number of iterations to convergence, which does pose a problem if the data is non-separable.
758758

759-
(a) 因为可分,所以$\forall\ n(1\le n \le N),y_n(w^{*T} x_n )>0$,然后因为$N$有限,所以$\rho = {\min}_{1\le n\le N} y_n(w^{*T} x_n )>0$
759+
(a) 因为可分,所以$\forall\ n(1\le n \le N),y_n(w^{*T} x_n )>0$,然后因为$N$有限,所以$\rho = {\min}_{1\le n\le N} y_n(w^{*T} x_n )>0$
760760

761761
(b)先回顾下更新规则:
762762
$$
@@ -768,15 +768,15 @@ $$
768768
$$
769769
\begin{aligned}
770770
w^T (t)w^*
771-
&=(w^T (t-1)+y(t)x^T(t))w^*\\
772-
&=w^T (t-1)w^*+y(t)x^T(t)w^*\\
773-
&=w^T (t-1)w^*+y(t)x(t)w^{*T}\\
771+
&=(w^T (t-1)+y(t-1)x^T(t-1))w^*\\
772+
&=w^T (t-1)w^*+y(t-1)x^T(t-1)w^*\\
773+
&=w^T (t-1)w^*+y(t-1)x(t-1)w^{*T}\\
774774
&\ge w^T(t- 1)w^*+\rho
775775
\end{aligned}
776776
$$
777-
这里$y(t)x^T(t)w^*=y(t)x(t)w^{*T}$是因为$x^T(t)w^*$是一个实数,所以它的转置$x(t)w^{*T}$等于它本身,最后一步是因为
777+
这里$y(t-1)x^T(t-1) w^*=y(t-1)x(t-1)w^{*T}$是因为$x^T(t-1)w^*$是一个实数,所以它的转置$x(t-1)w^{*T}$等于它本身,最后一步是因为
778778
$$
779-
y(t)x(t)w^{*T}\ge {\min}_{1\le n\le N} y_n(w^{*T} x_n )=\rho
779+
y(t-1)x(t-1)w^{*T}\ge {\min}_{1\le n\le N} y_n(w^{*T} x_n )=\rho
780780
$$
781781
再来证明 $w^T(t)w^* \ge t\rho​$,利用数学归纳法
782782
$t=0​$时,$w^T(t)w^*=w^T(0)w^*=0,t\rho=0​$,因此$t=0​$时结论成立
@@ -786,7 +786,7 @@ w^T (k+1)w^*\ge w^T(k)w^*+\rho\ge k\rho +\rho=(k+1)\rho
786786
$$
787787
所以$t=k+1​$时结论成立
788788

789-
(c)对$w(t + 1) = w(t) + y(t)x(t)$两边取模的平方,注意这里$||x||^2=x^Tx,x\in R^n$
789+
(c)对$w(t + 1) = w(t) + y(t)x(t)$两边取模的平方,注意这里$||x||^2=x^Tx,x\in \mathbb R^n$
790790
$$
791791
\begin{aligned}
792792
||w(t + 1)||^2
@@ -848,7 +848,7 @@ $$
848848
\sqrt t \frac {\rho}R\le||w^*||
849849
\\ t\le \frac {||w^*||^2R^2}{\rho^2}
850850
$$
851-
这意味着$t$是一个有限的数,所以PLA​一定会收敛
851+
这意味着$t$是一个有限的数,所以PLA​一定会收敛
852852

853853

854854

Chapter3/Chapter 3 The Linear Model.ipynb

Lines changed: 0 additions & 4679 deletions
This file was deleted.
-30.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)
0