0Pricing
Deep Learning Academy · درس

تطبيع المدخلات وتوحيدها

وسّع نطاق الميزات ليس converges التدريب

تطبيع المدخلات وتوحيدها درس مجاني في Deep Learning Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Deep Learning Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Raw Numbers Slow Learning

Features on wildly different scales, like age and salary, confuse a network. Rescaling them first is why normalization makes training converge faster. ⚖️

Two Common Recipes

You will meet two main scalers: standardization shifts data to mean zero and unit variance, while min-max squeezes it into a fixed range like 0 to 1.

Standardize with Mean and Std

Standardization subtracts the mean and divides by the standard deviation. The result is centered on zero with a spread of one, the deep learning default.

x = (x - x.mean()) / x.std()

Min-Max Scaling

Min-max scaling maps your smallest value to 0 and largest to 1. It is handy when a bounded input range matters, like pixel intensities.

x = (x - x.min()) / (x.max() - x.min())

Fit on Train Only

Compute the mean and std from the training set only. Reusing test data to set these stats leaks information and inflates your scores.

Reuse the Same Stats

Apply the exact training statistics to validation and test data. Both splits must be transformed the same way or your model sees mismatched inputs.

x_val = (x_val - train_mean) / train_std

Per-Channel for Images

For images you normalize each color channel with its own mean and std. PyTorch ships transforms.Normalize to do exactly this in a pipeline.

transforms.Normalize(mean=[0.5], std=[0.5])

Borrow Known ImageNet Stats

When using pretrained vision models, normalize with the ImageNet means and stds they were trained on. Matching those numbers keeps inputs in the expected range.

Do It Inside __getitem__

The cleanest spot to scale is your dataset's __getitem__ or a transform. Then every sample arrives normalized without extra code in your training loop.

Watch for Divide by Zero

If a feature is constant its std is zero and dividing explodes. Add a tiny epsilon to the denominator to keep the math safe and stable.

x = (x - mean) / (std + 1e-8)

Small Step, Big Payoff

Normalizing inputs is a quick preprocessing habit, yet it often unlocks faster, more stable training. Skip it and even a good model may crawl.

Quick Check

From which split should you compute normalization statistics?

Recap

Normalization rescales features so training converges, using stats fit on the training set and reused everywhere, often inside a transform. 🎉

الأسئلة الشائعة

هل درس «تطبيع المدخلات وتوحيدها» مجاني؟

نعم — نص درس «تطبيع المدخلات وتوحيدها» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Deep Learning Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.

ماذا ستتعلم في «تطبيع المدخلات وتوحيدها»؟

وسّع نطاق الميزات ليس converges التدريب تتمرن على Deep Learning Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Deep Learning Academy؟

لا تُشترط خبرة سابقة. Deep Learning Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «تطبيع المدخلات وتوحيدها»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Deep Learning Academy هذا؟

نعم. كل درس في Deep Learning Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. كتابة فئة Dataset مخصّصة
  2. التجميع والخلط وnum_workers
  3. ‏collate_fn للمدخلات متفاوتة الطول
  4. تطبيع المدخلات وتوحيدها
← العودة إلى Deep Learning Academy