0Pricing
NLP Academy · Lección

Puertas que controlan la memoria

Cómo las LSTM deciden qué conservar

Puertas que controlan la memoria es una lección gratuita de NLP Academy en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de NLP Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de NLP Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

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. ✅

Preguntas frecuentes

¿La lección «Puertas que controlan la memoria» es gratis?

Sí — el texto completo de «Puertas que controlan la memoria» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de NLP Academy, actualiza a CoddyKit PRO. El curso de NLP Academy incluye 4 lecciones en total.

¿Qué aprenderé en «Puertas que controlan la memoria»?

Cómo las LSTM deciden qué conservar Practicas NLP Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar NLP Academy?

No se requiere experiencia previa. NLP Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.

¿Cuánto tiempo toma la lección «Puertas que controlan la memoria»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de NLP Academy?

Sí. Cada lección de NLP Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Puertas que controlan la memoria
  2. GRU: una alternativa más ligera
  3. Entrenamiento de un clasificador LSTM
  4. Capas bidireccionales y apiladas
← Volver a NLP Academy