0Pricing
NLP Academy · درس

بوابات تتحكم في الذاكرة

كيف تقرر LSTMs ما الذي تحتفظ به

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

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

Plain RNNs Forget

A simple RNN struggles to remember things from far back. The LSTM was built to fix that by carefully managing what it keeps and forgets. 🧠

The Cell State

An LSTM carries a special cell state, a memory line that runs straight through every step so important signals survive long sequences.

Gates Are the Trick

The magic is in the gates: tiny learned switches that decide what to add, keep, or drop from memory at each time step.

How a Gate Works

Each gate uses a sigmoid to output values from 0 to 1, acting like a dimmer that lets some information through and blocks the rest.

gate = sigmoid(W @ x + U @ h + b)  # values in [0, 1]

The Forget Gate

The forget gate looks at the new input and decides how much of the old memory to erase. A 0 wipes it; a 1 keeps it fully.

The Input Gate

The input gate controls how much fresh information gets written into the cell state, so only useful new signals are stored.

The Candidate Values

A candidate vector proposes what new content could enter memory. The input gate then scales how much of it actually gets added.

candidate = tanh(W @ x + U @ h + b)

Updating Memory

The new cell state blends old memory kept by the forget gate with fresh candidate values let in by the input gate.

c = forget * c_prev + input * candidate

The Output Gate

The output gate decides what part of the cell state becomes the visible hidden state passed to the next step and the layer above.

Why Gates Beat Forgetting

Because gates keep the cell state mostly additive, gradients flow back many steps without vanishing. That is how an LSTM remembers long context.

Three Gates, One Cell

So an LSTM has three gates guarding one memory line: forget, input, and output, each learned from data during training.

Quick Check

Test your grip on LSTM gates.

Recap

An LSTM protects a cell state with forget, input, and output gates. Those switches keep long-range memory alive where plain RNNs fail. ✅

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

هل درس «بوابات تتحكم في الذاكرة» مجاني؟

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

ماذا ستتعلم في «بوابات تتحكم في الذاكرة»؟

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

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

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

كم من الوقت يستغرق درس «بوابات تتحكم في الذاكرة»؟

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

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

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

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

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