Algorithms, Data, Models, and Learning
هوش مصنوعی برای همه: هوش مصنوعی چطور باهوش شد؟
- An algorithm as a specified procedure, illustrated by sorting fruit using explicit steps.
- Data as recorded examples or observations, with inputs and optional target answers.
- A model as a representation used to produce outputs from inputs.
- Handwritten rules versus adjustable model parameters.
- Training as a procedure that adjusts a model using examples; inference as using the resulting model.
- A diagram separating the training algorithm, training data, trained model, and new input.
- Why learning from data does not mean a system automatically learns from every conversation.
دستور مشخص، نه لزوماً یادگیری
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0 L10 5 L0 10 Z" class="tm-arrow"/></marker></defs><rect x="35" y="160" width="160" height="100" rx="20" class="tm-soft"/><circle cx="75" cy="190" r="15" class="tm-gold"/><circle cx="115" cy="210" r="15" class="tm-green"/><circle cx="155" cy="190" r="15" class="tm-gold"/><text x="115" y="290" text-anchor="middle" class="tm-text" font-size="20" direction="rtl">سبد میوه</text><rect x="290" y="170" width="170" height="90" rx="16" class="tm-surface"/><path d="M315 190 H435 M375 190 V225 M335 225 H415" class="tm-line"/><text x="375" y="290" text-anchor="middle" class="tm-text" font-size="20" direction="rtl">ترازو</text><rect x="590" y="80" width="175" height="90" rx="20" class="tm-green"/><text x="677" y="132" text-anchor="middle" class="tm-text" font-size="22" direction="rtl">سبک</text><rect x="590" y="260" width="175" height="90" rx="20" class="tm-gold"/><text x="677" y="312" text-anchor="middle" class="tm-text" font-size="22" direction="rtl">سنگین</text><path d="M195 210 H280" class="tm-line-accent" marker-end="url(#arrow)"/><text x="240" y="150" text-anchor="middle" class="tm-text2" font-size="17" direction="rtl">برداشتن</text><path d="M460 205 L580 125" class="tm-line-accent" marker-end="url(#arrow)"/><text x="505" y="90" text-anchor="middle" class="tm-text2" font-size="16" direction="rtl">کمتر یا مساوی مرز</text><path d="M460 230 L580 305" class="tm-line-accent" marker-end="url(#arrow)"/><text x="505" y="345" text-anchor="middle" class="tm-text2" font-size="16" direction="rtl">بیشتر از مرز</text><path d="M375 310 V365 H115 V310" class="tm-line" marker-end="url(#arrow)"/><text x="245" y="390" text-anchor="middle" class="tm-text2" font-size="18" direction="rtl">میوهٔ بعدی؛ تا خالی شدن سبد</text><rect x="140" y="12" width="520" height="48" rx="12" class="tm-accent"/><text x="400" y="43" text-anchor="middle" class="tm-text" font-size="21" direction="rtl">الگوریتم: قدمها، ترتیب، شرطها</text><text x="400" y="435" text-anchor="middle" class="tm-text-accent" font-size="20" direction="rtl">تغییر مرز: با ویرایش دستور توسط خودمان، نه یادگیری</text></svg>
```
داده، ورودی و جواب درست
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><rect x="80" y="65" width="640" height="220" rx="18" class="tm-surface"/><text x="400" y="45" text-anchor="middle" class="tm-text" font-size="22" direction="rtl">مجموعه آموزشی</text><rect x="110" y="110" width="580" height="65" rx="12" class="tm-soft"/><path d="M 626 129 C 602 112 596 148 616 159 C 623 164 628 159 633 160 C 653 157 658 119 636 127 Z" class="tm-accent"/><path d="M 630 128 Q 628 116 638 113" class="tm-line"/><text x="470" y="151" text-anchor="middle" class="tm-text" font-size="22">\(160\,\mathrm{g}\)</text><text x="235" y="151" text-anchor="middle" class="tm-text" font-size="22" direction="rtl">سیب</text><rect x="110" y="195" width="580" height="65" rx="12" class="tm-soft"/><circle cx="630" cy="227" r="22" class="tm-gold"/><text x="470" y="236" text-anchor="middle" class="tm-text" font-size="22">\(180\,\mathrm{g}\)</text><text x="235" y="236" text-anchor="middle" class="tm-text" font-size="22" direction="rtl">پرتقال</text><text x="470" y="94" text-anchor="middle" class="tm-text-accent" font-size="18" direction="rtl">وزن: ورودی</text><text x="235" y="94" text-anchor="middle" class="tm-text-green" font-size="18" direction="rtl">اسم میوه: برچسب</text><rect x="110" y="305" width="580" height="58" rx="12" class="tm-surface"/><text x="610" y="340" text-anchor="middle" class="tm-muted" font-size="17" direction="rtl">داده بدون برچسب</text><text x="425" y="340" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">وزن ثبتشده</text><text x="220" y="340" text-anchor="middle" class="tm-muted" font-size="18" direction="rtl">جواب نامعلوم</text><rect x="80" y="385" width="640" height="48" rx="12" class="tm-gold tm-enter"/><text x="400" y="415" text-anchor="middle" class="tm-text" font-size="19" direction="rtl">سیب و پرتقال میتوانند هموزن باشند؛ وزن بهتنهایی کافی نیست.</text></svg>
```
تغییر قاعده یا آموزش مدل؟
```svg
<svg viewBox="0 0 800 610" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto"><path d="M0 0 L8 4 L0 8 Z" class="tm-arrow"/></marker></defs><rect x="30" y="25" width="740" height="95" rx="14" class="tm-soft"/><text x="400" y="53" text-anchor="middle" class="tm-text" font-size="20" direction="rtl">مدل: وزن را به حدس میوه تبدیل میکند</text><text x="400" y="84" text-anchor="middle" class="tm-text2" font-size="17" direction="rtl">تا مرز: سیب | بالاتر از مرز: پرتقال</text><text x="400" y="109" text-anchor="middle" class="tm-text-accent" font-size="16" direction="rtl">پارامتر قابل تنظیم: مرز وزنی</text><rect x="30" y="140" width="740" height="105" rx="14" class="tm-surface"/><text x="400" y="167" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">مرز اولیه: \(150\,\mathrm{g}\)؛ وزن سیب: \(160\,\mathrm{g}\)</text><text x="400" y="199" text-anchor="middle" class="tm-text2" font-size="18" direction="rtl">حدس مدل: پرتقال ≠ برچسب ثبتشده: سیب</text><text x="400" y="229" text-anchor="middle" class="tm-text-accent" font-size="18" direction="rtl">حدس اشتباه</text><path d="M400 245 L400 265" class="tm-line-accent" marker-end="url(#arrow)"/><rect x="30" y="270" width="740" height="83" rx="14" class="tm-accent"/><text x="400" y="297" text-anchor="middle" class="tm-text" font-size="19" direction="rtl">الگوریتم آموزشی مخصوص این تمرین</text><text x="400" y="328" text-anchor="middle" class="tm-text" font-size="17" direction="rtl">سیب را پرتقال حدس زد؟ مرز را \(20\,\mathrm{g}\) بالا ببر؛ همه نمونهها را دوباره بررسی کن</text><path d="M400 353 L400 372" class="tm-line-accent" marker-end="url(#arrow)"/><rect x="30" y="378" width="740" height="91" rx="14" class="tm-green"/><text x="400" y="406" text-anchor="middle" class="tm-text" font-size="20">\(150+20=170\,\mathrm{g}\)</text><text x="400" y="435" text-anchor="middle" class="tm-text" font-size="17" direction="rtl">سیب زیر مرز ← حدس سیب؛ پرتقال بالای مرز ← حدس پرتقال</text><text x="400" y="458" text-anchor="middle" class="tm-text-green" font-size="16" direction="rtl">بدون خطا، فقط برای همین مجموعه کوچک</text><rect x="415" y="488" width="355" height="72" rx="12" class="tm-soft"/><text x="592" y="514" text-anchor="middle" class="tm-text" font-size="19" direction="rtl">ویرایش قاعده دستنویس</text><text x="592" y="542" text-anchor="middle" class="tm-text2" font-size="16" direction="rtl">انسان مستقیماً مرز را عوض میکند</text><rect x="30" y="488" width="355" height="72" rx="12" class="tm-accent tm-enter"/><text x="207" y="514" text-anchor="middle" class="tm-text" font-size="19" direction="rtl">آموزش مدل</text><text x="207" y="542" text-anchor="middle" class="tm-text" font-size="16" direction="rtl">الگوریتم با مثالها مرز را تنظیم میکند</text><text x="400" y="590" text-anchor="middle" class="tm-text2" font-size="17" direction="rtl">در هر دو روش انسان نقش دارد؛ آموزش هم دستور کار دارد</text></svg>
```
از آموزش تا پاسخ تازه
```svg
<svg viewBox="0 0 800 480" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto"><path d="M0 0 L8 4 L0 8" class="tm-arrow"/></marker></defs><text x="70" y="35" class="tm-text-accent" font-size="20" direction="rtl">آموزش</text><rect x="35" y="120" width="200" height="100" rx="12" class="tm-soft"/><text x="135" y="151" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">داده آموزشی</text><text x="135" y="183" text-anchor="middle" class="tm-text2" font-size="15" direction="rtl">وزنها + برچسب سیب یا پرتقال</text><path d="M235 170 H300" class="tm-line" marker-end="url(#arrow)"/><rect x="300" y="120" width="210" height="100" rx="12" class="tm-accent"/><text x="405" y="151" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">الگوریتم آموزش</text><text x="405" y="183" text-anchor="middle" class="tm-text2" font-size="15" direction="rtl">بررسی حدسها؛ تنظیم مرز</text><rect x="335" y="30" width="140" height="48" rx="10" class="tm-surface"/><text x="405" y="60" text-anchor="middle" class="tm-text" font-size="17" direction="rtl">مدل اولیه</text><path d="M405 78 V120" class="tm-line" marker-end="url(#arrow)"/><path d="M510 170 H565" class="tm-line-accent" marker-end="url(#arrow)"/><rect x="565" y="120" width="210" height="100" rx="12" class="tm-green"/><text x="670" y="151" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">مدل آموزشدیده</text><text x="670" y="183" text-anchor="middle" class="tm-text2" font-size="15" direction="rtl">قاعده تشخیص با مرز تنظیمشده</text><text x="75" y="290" class="tm-text-green" font-size="20">inference</text><rect x="285" y="295" width="225" height="85" rx="12" class="tm-soft"/><text x="397" y="325" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">میوه تازه</text><text x="397" y="353" text-anchor="middle" class="tm-text2" font-size="15" direction="rtl">فقط وزن؛ بدون جواب درست</text><path d="M510 320 L580 220" class="tm-line-accent" marker-end="url(#arrow)"/><text x="525" y="277" text-anchor="middle" class="tm-muted" font-size="14" direction="rtl">ورودی</text><path d="M670 220 V295" class="tm-line" marker-end="url(#arrow)"/><rect x="585" y="295" width="170" height="85" rx="12" class="tm-green"/><text x="670" y="325" text-anchor="middle" class="tm-text" font-size="18" direction="rtl">خروجی: سیب</text><text x="670" y="353" text-anchor="middle" class="tm-text2" font-size="15" direction="rtl">وزن زیر مرز است</text><rect x="80" y="412" width="675" height="50" rx="10" class="tm-gold tm-enter"/><text x="417" y="443" text-anchor="middle" class="tm-text" font-size="17" direction="rtl">حدس مدل تضمین درستی نیست؛ نوع واقعی میوه جداگانه بررسی میشود.</text></svg>
```
تغییر پاسخ، لزوماً یادگیری نیست
**Question:** اگر پاسخ مدل عوض شود یا اشتباهش را بگوییم، آیا یاد گرفته است؟
**Tempting answer:** ~~پاسخ عوض شده؛ پس پارامترهای مدل هم تغییر کردهاند.~~
**Test:** ورودی اول: «میوه داخل جعبه چیه؟»
اطلاعات تازه: «میوه پوست نارنجی داره.»
پاسخ میتواند عوض شود، با همان پارامترهای ثابت.
**Correct answer:** آموزش وقتی انجام میشود که فرایندی واقعاً پارامترهای مدل را تغییر دهد؛ استفاده از مدل یا ذخیرهٔ پیام، بهتنهایی آموزش نیست.
**Why:** ویرایش شرط توسط خودمان ← تغییر قاعدهٔ دستنویس
تنظیم مرز توسط الگوریتم با نمونههای جوابدار ← آموزش
دادن وزن میوهٔ تازه به مدلِ تنظیمشده ← inference
Back to course