Skip to content

Commit d849c30

Browse files
committed
Add missing \vx to non-linearity formula
Closes Atcold#812
1 parent f7a6788 commit d849c30

File tree

11 files changed

+93
-43
lines changed

11 files changed

+93
-43
lines changed

docs/_layouts/custom.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,56 @@
1515
$$\gdef \deriv #1 #2 {\frac{\D #1}{\D #2}}$$
1616
$$\gdef \pd #1 #2 {\frac{\partial #1}{\partial #2}}$$
1717
$$\gdef \set #1 {\left\lbrace #1 \right\rbrace} $$
18+
19+
% My colours
20+
21+
$$\gdef \aqua #1 {\textcolor{8dd3c7}{#1}} $$
22+
$$\gdef \yellow #1 {\textcolor{ffffb3}{#1}} $$
23+
$$\gdef \lavender #1 {\textcolor{bebada}{#1}} $$
24+
$$\gdef \red #1 {\textcolor{fb8072}{#1}} $$
25+
$$\gdef \blue #1 {\textcolor{80b1d3}{#1}} $$
26+
$$\gdef \orange #1 {\textcolor{fdb462}{#1}} $$
27+
$$\gdef \green #1 {\textcolor{b3de69}{#1}} $$
28+
$$\gdef \pink #1 {\textcolor{fccde5}{#1}} $$
29+
$$\gdef \vgrey #1 {\textcolor{d9d9d9}{#1}} $$
30+
$$\gdef \violet #1 {\textcolor{bc80bd}{#1}} $$
31+
$$\gdef \unka #1 {\textcolor{ccebc5}{#1}} $$
32+
$$\gdef \unkb #1 {\textcolor{ffed6f}{#1}} $$
33+
34+
% Vectors
35+
$$\gdef \vx {\pink{\vect{x }}} $$
36+
$$\gdef \vy {\blue{\vect{y }}} $$
37+
$$\gdef \vb {\vect{b}} $$
38+
$$\gdef \vz {\orange{\vect{z }}} $$
39+
$$\gdef \vtheta {\vect{\theta }} $$
40+
$$\gdef \vh {\green{\vect{h }}} $$
41+
$$\gdef \vq {\aqua{\vect{q }}} $$
42+
$$\gdef \vk {\yellow{\vect{k }}} $$
43+
$$\gdef \vv {\green{\vect{v }}} $$
44+
$$\gdef \vytilde {\violet{\tilde{\vect{y}}}} $$
45+
$$\gdef \vyhat {\red{\hat{\vect{y}}}} $$
46+
$$\gdef \vycheck {\blue{\check{\vect{y}}}} $$
47+
$$\gdef \vzcheck {\blue{\check{\vect{z}}}} $$
48+
$$\gdef \vztilde {\green{\tilde{\vect{z}}}} $$
49+
$$\gdef \vmu {\green{\vect{\mu}}} $$
50+
$$\gdef \vu {\orange{\vect{u}}} $$
51+
52+
% Matrices
53+
$$\gdef \mW {\matr{W}} $$
54+
$$\gdef \mA {\matr{A}} $$
55+
$$\gdef \mX {\pink{\matr{X}}} $$
56+
$$\gdef \mY {\blue{\matr{Y}}} $$
57+
$$\gdef \mQ {\aqua{\matr{Q }}} $$
58+
$$\gdef \mK {\yellow{\matr{K }}} $$
59+
$$\gdef \mV {\lavender{\matr{V }}} $$
60+
$$\gdef \mH {\green{\matr{H }}} $$
61+
62+
% Coloured math
63+
$$\gdef \cx {\pink{x}} $$
64+
$$\gdef \ctheta {\orange{\theta}} $$
65+
$$\gdef \cz {\orange{z}} $$
66+
$$\gdef \Enc {\lavender{\text{Enc}}} $$
67+
$$\gdef \Dec {\aqua{\text{Dec}}}$$
1868
</div>
1969

2070
{% if page.lecturer %}

docs/ar/week01/01-3.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Note that translation alone is not linear since 0 will not always be mapped to 0
6363
In our visualization, we have five branches of a spiral, with each branch corresponding to a different colour. The points live in a two dimensional plane and can be represented as a tuple; the colour represents a third dimension which can be thought of as the different classes for each of the points. We then use the network to separate each of the points by colour.
6464
-->
6565

66-
في النموذج أدناه، لدينا خمس تفرعات لولبية لكل منها لون مختلف. توجد النقاط في فضاء ثنائي البعد ونستطيع تمثيلها بزوجين من الأرقام ويمثل اللون بُعدًا ثالثًا نستخدمه للتصنيف بين النقاط. وبعد ذلك نستطيع إستخدام الشبكة العصبية لفصل كل نقطة من النقاط بناءً على اللون.
66+
في النموذج أدناه، لدينا خمس تفرعات لولبية لكل منها لون مختلف. توجد النقاط في فضاء ثنائي البعد ونستطيع تمثيلها بزوجين من الأرقام ويمثل اللون بُعدًا ثالثًا نستخدمه للتصنيف بين النقاط. وبعد ذلك نستطيع إستخدام الشبكة العصبية لفصل كل نقطة من النقاط بناءً على اللون.
6767

6868
<!--
6969
| <center><img src="{{site.baseurl}}/images/week01/01-3/Spiral1.png" width="200px"/></center> | <center><img src="{{site.baseurl}}/images/week01/01-3/Spiral2.png" width="200px"/></center> |
@@ -81,7 +81,7 @@ In our visualization, we have five branches of a spiral, with each branch corres
8181
The network \"stretches\" the space fabric in order to separate each of the points into different subspaces. At convergence, the network separates each of the colours into different subspaces of the final manifold. In other words, each of the colours in this new space will be linearly separable using a one *vs.* all regression. The vectors in the diagram can be represented by a five by two matrix; this matrix can be multiplied to each point to return scores for each of the five colours. Each of the points can then be classified by colour using their respective scores. Here, the output dimension is five, one for each of the colours, and the input dimension is two, one for the x and y coordinates of each of the points. To recap, this network basically takes the space fabric and performs a space transformation parametrised by several matrices and then by non-linearities.
8282
-->
8383

84-
تقوم الشبكة /"بتمديد/" نسيج الفضاء حتى نستطيع فصل كل نقطة إلى أجزاء فرعية مختلفة. عند التقارب للتنيجة نجد أن الشبكة قد فصلت كل لون إلى فضاء فرعي مختلف من المتشعب النهائي (manifold). بعبارة أخرى يمكن فصل كل لون في الفضاء الجديد فصله بشكل خطي عن طريق استخدام انحدار واحد *مقابل* عدة انحدارات. يمكن تمثيل المتجهات بالرسم التوضيحي عن طريق مصفوفه بحجم 2 $times$ 5، وضرب تلك المصفوفة بكل نقطة لاسترجاع درجة كل لون من الألوان الخمسة. حينئذ يمكن تصنيف النقاط باللون حسب درجات كل نقطة. تتكون المخرجات من خمسة عناصر، حيث يمثل كل منها لونًا ما، بينما تتكون المدخلات من عنصرين واحد للإحداثي السيني وآخر للإحداثي الصادي للنقاط. للتلخيص هذه الشبكة تأخذ نسيج الفضاء وتقوم بتشكيله باستخدام عدة مصفوفات يتلوها عمليات لاخطية.
84+
تقوم الشبكة /"بتمديد/" نسيج الفضاء حتى نستطيع فصل كل نقطة إلى أجزاء فرعية مختلفة. عند التقارب للتنيجة نجد أن الشبكة قد فصلت كل لون إلى فضاء فرعي مختلف من المتشعب النهائي (manifold). بعبارة أخرى يمكن فصل كل لون في الفضاء الجديد فصله بشكل خطي عن طريق استخدام انحدار واحد *مقابل* عدة انحدارات. يمكن تمثيل المتجهات بالرسم التوضيحي عن طريق مصفوفه بحجم 2 $times$ 5، وضرب تلك المصفوفة بكل نقطة لاسترجاع درجة كل لون من الألوان الخمسة. حينئذ يمكن تصنيف النقاط باللون حسب درجات كل نقطة. تتكون المخرجات من خمسة عناصر، حيث يمثل كل منها لونًا ما، بينما تتكون المدخلات من عنصرين واحد للإحداثي السيني وآخر للإحداثي الصادي للنقاط. للتلخيص هذه الشبكة تأخذ نسيج الفضاء وتقوم بتشكيله باستخدام عدة مصفوفات يتلوها عمليات لاخطية.
8585

8686

8787

@@ -97,14 +97,14 @@ Figure 2: Network Architecture
9797
</center>
9898
-->
9999

100-
<center> <img src="{{site.baseurl}}/images/week01/01-3/Network.png" style="zoom: 40%; background-color:#DCDCDC;" /><br> شكل ٢: هندسة الشبكة</center>
100+
<center> <img src="{{site.baseurl}}/images/week01/01-3/Network.png" style="zoom: 40%; background-color:#DCDCDC;" /><br> شكل ٢: هندسة الشبكة</center>
101101

102102
<!--
103103
The first matrix maps the two dimensional input to a 100 dimensional intermediate hidden layer. We then have a non-linear layer, `ReLU` or Rectified Linear Unit, which is simply *positive part* $(\cdot)^+$ function. Next, to display our image in a graphical representation, we include an embedding layer that maps the 100 dimensional hidden layer input to a two-dimensional output. Lastly, the embedding layer is projected to the final, five-dimensional layer of the network, representing a score for each colour.
104104
105105
-->
106106

107-
تربط المصفوفة الأولى المدخل ثنائي الأبعاد بطبقة خفية وسطية ذات ١٠٠ بعد. لدينا وبعد ذلك طبقة لاخطية ألا وهي دالة `ReLU` وهي وحدة خطية مصححة، والتي تعبر ببساطة عن *الجزء الموجب* $(\cdot)^+$ من المعادلة. وليتم عرض الصورة بشكل رسومي نضيف طبقة التضمين (embedding layer) والتي تقوم بربط الطبقة الخفية المدخلة ذات الـ ١٠٠ بُعد بمخرج ثنائي الأبعاد. أخيرا يتم إسقاط طبقة التضمين على الطبقة ذات الأبعاد الخمسة في الشبكة، والتي تمثل قيمة لكل لون.
107+
تربط المصفوفة الأولى المدخل ثنائي الأبعاد بطبقة خفية وسطية ذات ١٠٠ بعد. لدينا وبعد ذلك طبقة لاخطية ألا وهي دالة `ReLU` وهي وحدة خطية مصححة، والتي تعبر ببساطة عن *الجزء الموجب* $(\cdot)^+$ من المعادلة. وليتم عرض الصورة بشكل رسومي نضيف طبقة التضمين (embedding layer) والتي تقوم بربط الطبقة الخفية المدخلة ذات الـ ١٠٠ بُعد بمخرج ثنائي الأبعاد. أخيرا يتم إسقاط طبقة التضمين على الطبقة ذات الأبعاد الخمسة في الشبكة، والتي تمثل قيمة لكل لون.
108108

109109

110110
<!--
@@ -118,7 +118,7 @@ The Jupyter Notebook can be found [here] (https://github.com/Atcold/pytorch-Deep
118118

119119

120120

121-
مفكرة جوبيتر بالإمكان الوصول لها من [هنا](https://github.com/Atcold/pytorch-Deep-Learning/blob/master/02-space_stretching.ipynb). للتمكن من تشغيل المفكرة عليك التأكد من تحميل بيئة `pDL` كما هو موضح في [`README.md`](https://github.com/Atcold/pytorch-Deep-Learning/blob/master/README.md).
121+
مفكرة جوبيتر بالإمكان الوصول لها من [هنا](https://github.com/Atcold/pytorch-Deep-Learning/blob/master/02-space_stretching.ipynb). للتمكن من تشغيل المفكرة عليك التأكد من تحميل بيئة `pDL` كما هو موضح في [`README.md`](https://github.com/Atcold/pytorch-Deep-Learning/blob/master/README.md).
122122

123123
<!--
124124
### PyTorch `device`
@@ -158,7 +158,7 @@ To see the documentation for a function in a notebook cell, use `Shift + Tab.`
158158
-->
159159

160160

161-
### إرشادات مفكرة جوبيتر
161+
### إرشادات مفكرة جوبيتر
162162

163163

164164

@@ -228,7 +228,7 @@ The matrices used were generated with Numpy; however, we can also use PyTorch's
228228
Next, we visualize the following transformation:
229229
230230
$$
231-
f(x) = \tanh\bigg(\begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} \bigg)
231+
f(\vx) = \tanh\bigg(\begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} \vx \bigg)
232232
$$
233233
234234
Recall, the graph of $\tanh(\cdot)$ in Fig. 4.
@@ -246,15 +246,15 @@ The effect of this non-linearity is to bound points between $-1$ and $+1$, creat
246246
<center> Figure 5: Non-linear Transformations </center>
247247
248248
-->
249-
### التحولات غير الخطية
249+
### التحولات غير الخطية
250250

251251

252252

253-
لنقوم الآن بتمثيل التحول التالي
253+
لنقوم الآن بتمثيل التحول التالي
254254

255255

256256
$$
257-
f(x) = \tanh\bigg(\begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} \bigg)
257+
f(\vx) = \tanh\bigg(\begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} \vx \bigg)
258258
$$
259259

260260
تذكر رسمة $\tanh(\cdot)$ في شكل ٤

docs/en/week01/01-3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The matrices used were generated with Numpy; however, we can also use PyTorch's
9494
Next, we visualize the following transformation:
9595

9696
$$
97-
f(x) = \tanh\bigg(\begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} \bigg)
97+
f(\vx) = \tanh\bigg(\begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} \vx \bigg)
9898
$$
9999

100100
Recall, the graph of $\tanh(\cdot)$ in Fig. 4.

0 commit comments

Comments
 (0)