الرئيسية / مقرر Deep Learning / الفصل 6 الجزء 2

الفصل 6 (الجزء 2): Convolutional Neural Networks

Channels, feature maps and a LeNet-style network

على طول: نركّب conv وpooling وطبقة كاملة، وده الـ CNN.

فيديو المحاضرة

فيديو المحاضرة

بعد الفيديو: الأمثلة والاختبار والتمارين والمشروع الصغير تحت.

رسوم متحركة

الطبقات ورا بعض

أمثلة Python

أمثلة قصيرة وبسيطة

الكود قصير والنتيجة اتجرّبت فعلاً. عدّل في المحرر واضغط شغّل.

المثال ١: عدد الأوزان

Sample output (press Run to produce your own):
3x3 conv 1 -> 8  : 80
3x3 conv 8 -> 16 : 1168
dense 64 -> 8    : 520

المثال ٢: بلوك conv + ReLU + pooling

Sample output (press Run to produce your own):
after conv: (6, 6)  after pooling: (3, 3)

المثال ٣: كم يتحوّل الحجم

Sample output (press Run to produce your own):
block 1 -> size 12 x 12 , channels 6
block 2 -> size 4 x 4 , channels 16
flattened: 256

افتح الفصل المقابل في كتاب d2l.ai

اختبار قصير

اختبر فهمك

1. A conv layer with 16 filters produces:

2. A 3x3 conv from 1 to 8 channels has how many weights?

3. Typical CNN blocks make the maps:

4. What does the final fully connected layer do?

5. LeNet showed that:

تمارين برمجة

جرّب بإيدك

التمرين 1

احسب عدد أوزان conv بـ filter 5x5 من 3 channels لـ 6 channels.

Compute the number of weights of a 5x5 conv from 3 channels to 6 channels.

(output appears here)

التمرين 2

طبّق max pooling ٢×٢ على مصفوفة 4×4 من 0 لـ 15 واطبع الناتج.

Apply 2x2 max pooling to the 4x4 array of 0..15 and print the result.

(output appears here)

مشروع صغير في آخر المحاضرة

Features بـ filters ثابتة ثم classifier على الأرقام

الداتا: Optical Recognition of Handwritten Digits: 1797 images of 8x8 pixels, 10 classes. Source: UCI Machine Learning Repository.

License / source: Ships with scikit-learn. Dataset page

الخطوات

  1. حمّل digits، اقسم ٨٠/٢٠.
  2. اعمل ٤ filters: حواف رأسية وأفقية ومائلتين.
  3. لكل صورة: conv ثم ReLU ثم max pooling ٢×٢، وبعدين افرد الخرج.
  4. درّب LogisticRegression على الـ features الجديدة وقارنها بـ pixels الخام.
Expected output (press Run to produce your own):
conv features   : 0.978
raw pixels      : 0.964

مشروع نهاية الفصل

ملف المشروع العملي للفصل 6

ملف PDF فيه مشروع صغير بأسئلة عملية تطبّق بيها كل اللي اتعلمته في الفصل، مع حل نموذجي في الآخر.

افتح ملف المشروع (PDF)

Credits: the topic order follows the book "Dive into Deep Learning" (d2l.ai) by Zhang, Lipton, Li and Smola, whose text is licensed CC BY-SA 4.0. The explanations, diagrams and code in this lecture are our own and are not copied from the book. Reference: d2l.ai, Convolutional Neural Networks (LeNet).