Neural Networks and Learning Representations
هوش مصنوعی برای همه: هوش مصنوعی چطور باهوش شد؟
- Early artificial neuron models in the 1940s and learnable single-layer classifiers in the 1950s.
- Inputs, weights, a bias, and an activation through a small numerical diagram.
- Why a single simple boundary cannot solve every classification problem.
- Hidden layers as intermediate representations that transform the input.
- Learning useful features rather than specifying every feature by hand.
- The limits of the brain analogy: artificial networks are mathematical models, not faithful copies of brains.
از نورون ساده تا یادگیری
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><rect class="tm-surface" x="70" y="145" width="250" height="150" rx="16"/><text class="tm-text" x="195" y="185" font-size="20" text-anchor="middle" direction="rtl">نورون مصنوعی</text><text class="tm-muted" x="195" y="225" font-size="16" text-anchor="middle" direction="rtl">ورودیها</text><text class="tm-muted" x="195" y="255" font-size="16" text-anchor="middle" direction="rtl">شرط ساده</text><rect class="tm-accent" x="475" y="145" width="250" height="150" rx="16"/><text class="tm-text" x="600" y="185" font-size="20" text-anchor="middle">perceptron</text><text class="tm-text" x="600" y="225" font-size="16" text-anchor="middle" direction="rtl">دستهبند تکلایه</text><text class="tm-text" x="600" y="255" font-size="16" text-anchor="middle" direction="rtl">وزنهای تنظیمپذیر</text><path class="tm-line-accent" d="M320 220 L465 220" marker-end="url(#arrow)"/><defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto"><path class="tm-arrow" d="M0,0 L10,5 L0,10 z"/></marker></defs></svg>
```
محاسبه در یک نورون
ورودیها: \(x_1=x_2=1\)، وزنها: \(w_1=w_2=1\)، و \(b=-1\). قاعده: اگر جمع بزرگتر از صفر باشد خروجی \(1\)، وگرنه \(0\).
**سهم ورودی اول**
\[ x_1w_1=1\cdot1=1 \]
**سهم ورودی دوم و جمع**
\[ x_2w_2=1\cdot1=1,\qquad x_1w_1+x_2w_2=1+1=2 \]
**افزودن bias**
\[ z=x_1w_1+x_2w_2+b=2+(-1)=1 \]
**activation**
\[ y=\begin{cases}1 & z>0\\0 & z\leq 0\end{cases},\qquad z=1\Longrightarrow y=1 \]
**صفر کردن ورودی دوم**
\[ x_2=0\Longrightarrow x_2w_2=0,\qquad z=1+0+(-1)=0 \]
**خروجی جدید**
\[ z=0\Longrightarrow y=0 \]
چرا XOR جداشدنی نیست
```tikz
\begin{tikzpicture}[scale=1.05]
\draw[->] (0,0) -- (5.2,0) node[right] {$x_1$};
\draw[->] (0,0) -- (0,5.2) node[above] {$x_2$};
\fill (1,1) circle (3pt) node[below left] {$(\mbox{0,0}):0$};
\fill (4,1) circle (3pt) node[below right] {$(\mbox{1,0}):1$};
\fill (1,4) circle (3pt) node[above left] {$(\mbox{0,1}):1$};
\fill (4,4) circle (3pt) node[above right] {$(\mbox{1,1}):0$};
\node at (2.5,0.35) {XOR};
\draw[dashed] (4,1) -- (1,4);
\draw[dashed] (1,1) -- (4,4);
\fill (2.5,2.5) circle (2pt) node[below right] {};
\draw[very thick] (0.6,3.8) -- (4.4,1.2);
\node at (3.3,3.7) {};
\end{tikzpicture}
```
حل XOR با دو ویژگی میانی
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><defs><marker id="a" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto"><path d="M0,0 L0,6 L9,3 z" class="tm-arrow"/></marker></defs><rect x="55" y="75" width="130" height="58" rx="10" class="tm-soft"/><text x="120" y="110" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">ورودیها</text><rect x="320" y="55" width="155" height="60" rx="10" class="tm-accent"/><text x="397" y="91" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">ویژگی ۱: OR</text><rect x="320" y="145" width="155" height="60" rx="10" class="tm-gold"/><text x="397" y="181" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">ویژگی ۲: AND</text><path d="M185 95 C240 95 260 85 320 85" class="tm-line" marker-end="url(#a)"/><path d="M185 112 C240 150 260 175 320 175" class="tm-line" marker-end="url(#a)"/><rect x="575" y="95" width="165" height="70" rx="10" class="tm-green"/><text x="657" y="125" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">نورون خروجی</text><text x="657" y="150" text-anchor="middle" class="tm-text" font-size="16">OR − 2AND</text><path d="M475 85 C520 85 530 110 575 120" class="tm-line-accent" marker-end="url(#a)"/><path d="M475 175 C520 175 530 150 575 140" class="tm-line-accent" marker-end="url(#a)"/><text x="115" y="245" text-anchor="middle" class="tm-text2" font-size="17" direction="rtl">لایهٔ پنهان</text><text x="115" y="290" text-anchor="middle" class="tm-muted" font-size="15" direction="rtl">تشخیص ویژگیها</text><text x="657" y="220" text-anchor="middle" class="tm-text-green" font-size="16" direction="rtl">لایهٔ خروجی</text><rect x="245" y="315" width="310" height="78" rx="10" class="tm-soft tm-enter"/><text x="400" y="345" text-anchor="middle" class="tm-text" font-size="17" direction="rtl">ورودی → ویژگیهای تازه → جواب</text><text x="400" y="375" text-anchor="middle" class="tm-text2" font-size="16" direction="rtl">XOR: ۰، ۱، ۱، ۰</text></svg>
```
وزنها نمایش را میسازند
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto"><path d="M0,0 L0,6 L9,3 z" class="tm-arrow"/></marker></defs><rect x="35" y="80" width="145" height="58" rx="10" class="tm-surface"/><text x="107" y="115" class="tm-text" font-size="17" text-anchor="middle" direction="rtl">ورودیها</text><rect x="270" y="48" width="175" height="70" rx="10" class="tm-soft"/><text x="357" y="77" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">نورون میانی ۱</text><text x="357" y="101" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">ویژگی میانی</text><rect x="270" y="150" width="175" height="70" rx="10" class="tm-soft"/><text x="357" y="179" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">نورون میانی ۲</text><text x="357" y="203" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">ویژگی میانی</text><rect x="575" y="95" width="155" height="72" rx="10" class="tm-surface"/><text x="652" y="124" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">نورون نهایی</text><text x="652" y="149" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">خروجی</text><path d="M180 105 L270 83" class="tm-line" marker-end="url(#arrow)"/><path d="M180 115 L270 185" class="tm-line" marker-end="url(#arrow)"/><path d="M445 83 L575 115" class="tm-line" marker-end="url(#arrow)"/><path d="M445 185 L575 145" class="tm-line-accent" marker-end="url(#arrow)"/><text x="220" y="78" class="tm-text2" font-size="14" text-anchor="middle" direction="rtl">۴ وزن</text><text x="510" y="88" class="tm-text2" font-size="14" text-anchor="middle" direction="rtl">۲ وزن</text><text x="505" y="218" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">نمایش میانی</text><rect x="35" y="290" width="695" height="88" rx="12" class="tm-soft"/><text x="382" y="325" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">آموزش: مثالهای برچسبدار ← کاهش خطا</text><text x="382" y="355" class="tm-text-accent" font-size="17" text-anchor="middle" direction="rtl">وزنها و biasها تنظیم میشوند</text><rect x="270" y="48" width="175" height="70" rx="10" class="tm-accent tm-pulse"/><text x="357" y="77" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">نورون میانی ۱</text><text x="357" y="101" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">ویژگی میانی</text><rect x="270" y="150" width="175" height="70" rx="10" class="tm-accent tm-pulse"/><text x="357" y="179" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">نورون میانی ۲</text><text x="357" y="203" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">ویژگی میانی</text><text x="382" y="414" class="tm-text2" font-size="16" text-anchor="middle" direction="rtl">ممکن است قانون انسانیِ خوانا نداشته باشد</text></svg>
```
Back to course