0Pricing
Deep Learning Academy · Lektion

Die einfache RNN-Zelle

Führen Sie einen Hidden State über mehrere Schritte hinweg weiter.

Die einfache RNN-Zelle ist eine kostenlose Deep Learning Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Deep Learning Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Deep Learning Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

What a Cell Does

An RNN cell is the tiny engine that runs at each time step. You feed it one input and the old memory, and it returns the new memory.

Two Inputs Per Step

Every step the cell takes two things: the current input x and the previous hidden state. It mixes them into a fresh hidden state.

The Core Formula

The vanilla cell computes a weighted sum of input and memory, then squashes it. That single line is the heart of the RNN.

h_t = tanh(W_x @ x_t + W_h @ h_prev + b)

Why tanh?

The tanh activation keeps the hidden state bounded between -1 and 1, so memory values stay stable instead of blowing up over many steps.

Two Weight Matrices

One matrix W_x reads the new input; another W_h reads the old memory. The cell learns both to decide what to keep and what to add.

The Initial Hidden State

Before step one there is no memory, so the hidden state starts as a vector of zeros and gets filled in as the sequence flows through.

h0 = torch.zeros(hidden_size)

Unrolling Through Time

Picture the cell copied once per step, with memory passed along the chain. This view is called unrolling the network through time.

Outputs From Memory

Need a prediction at a step? Pass that step's hidden state through a small output layer to get logits or a value.

y_t = W_y @ h_t + b_y

Use It in PyTorch

PyTorch gives you nn.RNN so you don't hand-code the loop. You set input and hidden sizes, then feed a batched sequence.

rnn = nn.RNN(input_size=10, hidden_size=20)

Outputs and Final State

Calling the layer returns two things: the outputs at every step and the final hidden state, handy for classifying the whole sequence.

out, h_n = rnn(x)

The Catch

Vanilla RNNs work, but their memory fades fast over long sequences. That weakness sets the stage for gated cells like the LSTM.

Quick Check

What two things does a vanilla RNN cell take as input each step?

Recap

The vanilla cell blends input and old memory with tanh to make a new hidden state, repeated step by step across the sequence. ✅

Häufig gestellte Fragen

Ist die Lektion „Die einfache RNN-Zelle“ kostenlos?

Ja — der vollständige Text von „Die einfache RNN-Zelle“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Deep Learning Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Deep Learning Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Die einfache RNN-Zelle“?

Führen Sie einen Hidden State über mehrere Schritte hinweg weiter. Du übst Deep Learning Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Deep Learning Academy zu starten?

Keine Vorkenntnisse erforderlich. Deep Learning Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.

Wie lange dauert die Lektion „Die einfache RNN-Zelle“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Deep Learning Academy-Lektion Code schreiben und ausführen?

Ja. Jede Deep Learning Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Warum Sequenzen ein Gedächtnis brauchen
  2. Die einfache RNN-Zelle
  3. LSTM- und GRU-Gates
  4. Sequenzen packen und Padding verarbeiten
← Zurück zu Deep Learning Academy