0Pricing
Deep Learning Academy · درس

تتبّع الدقة أثناء التدريب

حوّل التنبؤات إلى نتيجة

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

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

Loss Alone Lies a Little

A falling loss feels good, but it is abstract. To know if your model is truly useful you also want accuracy, the share of predictions it gets right. 🎯

From Logits to a Choice

Your model outputs raw scores per class. To pick a prediction you take the index of the largest score with argmax along the class dimension.

preds = pred.argmax(dim=1)

Compare to the Truth

Now compare each predicted class to the real label. The result is a boolean tensor where True marks every example the model got right.

correct = preds == y

Count the Wins

Booleans add up like ones and zeros, so summing the matches gives a count of correct predictions in this batch.

num_correct = correct.sum().item()

Turn Count Into a Rate

Divide correct predictions by the batch size and you get accuracy, a number from zero to one that is easy to read as a percentage.

acc = num_correct / y.size(0)

Accumulate Across Batches

Per-batch accuracy is noisy, so keep running totals of correct and seen examples. Their ratio gives a stable epoch accuracy.

total_correct += num_correct
total_seen += y.size(0)

Report Each Epoch

At the end of an epoch compute the overall rate and print it beside the loss. Now you see both how confident and how correct the model is.

epoch_acc = total_correct / total_seen

Keep Metrics off the Graph

When you only measure, wrap scoring in no_grad. It stops PyTorch from tracking operations you never plan to backpropagate, saving memory.

with torch.no_grad():
    preds = model(x).argmax(dim=1)

Accuracy Is Not Enough Alone

On imbalanced data accuracy can fool you: always guessing the common class scores high yet learns nothing. Pair it with loss and other metrics.

Watch the Trend

One epoch's number means little; the trend is everything. Rising accuracy with falling loss is the clear sign your training is on track.

A Window Into Learning

Tracking accuracy turns training from a black box into something you can watch. Each epoch you get honest feedback on real progress.

Quick Check

How do you turn class scores into a single predicted label?

Recap

You learned to track accuracy: argmax the scores, compare to labels, count correct, and divide. Watch the trend alongside loss. 🎉

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

هل درس «تتبّع الدقة أثناء التدريب» مجاني؟

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

ماذا ستتعلم في «تتبّع الدقة أثناء التدريب»؟

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

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

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

كم من الوقت يستغرق درس «تتبّع الدقة أثناء التدريب»؟

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

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

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

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

  1. المرور الأمامي والخسارة والمرور العكسي والخطوة
  2. كتابة حلقة تدريب مصغّرة
  3. تتبّع الدقة أثناء التدريب
  4. وضعا Train وEval
← العودة إلى Deep Learning Academy