0Pricing
NLP Academy · درس

الطبقات ثنائية الاتجاه والمكدّسة

اقرأ السياق من كلا الاتجاهين

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

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

One Direction Is Limiting

A plain LSTM reads left to right, so it only knows the past. But meaning often depends on words that come later too. 🔄

Reading Both Ways

A bidirectional LSTM runs two passes: one forward and one backward, so each word sees context from both sides.

Merging the Passes

The forward and backward outputs are joined, usually concatenated, into one richer representation for every time step.

Why It Helps

Future context resolves ambiguity. Knowing the word after a name helps decide if Apple means a fruit or a company.

Bidirectional in Keras

You wrap any recurrent layer to make it two-way. The Bidirectional wrapper handles both passes for you automatically.

model.add(Bidirectional(LSTM(64)))

Going Deeper

You can also stack layers: feed one LSTM's output into another so the network learns higher-level sequence patterns.

Return the Full Sequence

To stack, the lower LSTM must output every step, not just the last. Set return_sequences to true so the next layer has input.

LSTM(64, return_sequences=True)

A Two-Layer Stack

The first LSTM returns sequences; the second reads them and returns a single summary vector for classification.

model.add(LSTM(64, return_sequences=True))
model.add(LSTM(32))

More Power, More Risk

Deeper and bidirectional models capture more, but they have more parameters and can overfit. Use dropout and enough data.

Combine Both Ideas

You can stack bidirectional layers together for a strong model: wide context plus depth, common in serious NLP systems.

model.add(Bidirectional(LSTM(64, return_sequences=True)))

Pick What Fits

Not every task needs depth. Start small, then add layers or direction only if validation scores actually improve.

Quick Check

Confirm how stacking LSTMs works.

Recap

Go bidirectional to read both ways and stack layers for depth. Both add power, so guard against overfitting with dropout. ✅

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

هل درس «الطبقات ثنائية الاتجاه والمكدّسة» مجاني؟

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

ماذا ستتعلم في «الطبقات ثنائية الاتجاه والمكدّسة»؟

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

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

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

كم من الوقت يستغرق درس «الطبقات ثنائية الاتجاه والمكدّسة»؟

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

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

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

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

  1. بوابات تتحكم في الذاكرة
  2. GRU: بديل أبسط
  3. تدريب مصنّف LSTM
  4. الطبقات ثنائية الاتجاه والمكدّسة
← العودة إلى NLP Academy