0Pricing
Deep Learning Academy · Lektion

Ein Perzeptron von Grund auf programmieren

Ein Neuron in wenigen Zeilen Python.

Ein Perzeptron von Grund auf programmieren ist eine kostenlose Deep Learning Academy-Lektion auf CoddyKit. Dies ist Lektion 3 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 Is a Perceptron

A perceptron is one neuron plus a learning rule. It is the original trainable building block of neural networks, and you can code it from scratch. 🛠️

Start with Weights

First create the weights and a bias. Starting them at zero is fine for a perceptron; learning will move them where they need to be.

weights = [0.0, 0.0]
bias = 0.0

Predict with a Step

The predict step computes the weighted sum, then applies the step function to return 0 or 1.

score = w[0]*x[0] + w[1]*x[1] + bias
return 1 if score >= 0 else 0

Measure the Error

Compare the prediction to the true label. The error is simply target minus prediction: 0 when right, plus or minus one when wrong.

error = target - prediction

The Update Rule

The update rule nudges each weight by the error times the input. Wrong guesses push the weights toward the correct answer.

w[i] += lr * error * x[i]

Update the Bias Too

The bias learns the same way, but its input is always 1. So you simply add the learning rate times the error.

bias += lr * error

The Learning Rate

The learning rate scales how big each update is. Small values learn slowly but steadily; large ones can overshoot the answer.

lr = 0.1

One Pass: an Epoch

Looping once over every training example is called an epoch. You usually repeat for several epochs until mistakes stop.

The Training Loop

Each step of training predicts, measures error, and updates the weights and bias. Repeat across the dataset to learn.

for x, target in data:
    err = target - predict(x)
    update(x, err)

It Learns AND

Feed it the AND truth table and the perceptron converges fast. Both inputs must be 1 for it to output 1.

Convergence Guarantee

If the data is linearly separable, the perceptron is guaranteed to find a separating line. That promise is the convergence theorem.

Quick Check

Recall how a perceptron corrects itself.

Recap

A perceptron predicts with a step, measures error, and updates weights by lr times error times input. Repeat over epochs and it learns separable data. ✅

Häufig gestellte Fragen

Ist die Lektion „Ein Perzeptron von Grund auf programmieren“ kostenlos?

Ja — der vollständige Text von „Ein Perzeptron von Grund auf programmieren“ 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 „Ein Perzeptron von Grund auf programmieren“?

Ein Neuron in wenigen Zeilen Python. 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 3 von 4.

Wie lange dauert die Lektion „Ein Perzeptron von Grund auf programmieren“?

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. Gewichte, Bias und die gewichtete Summe
  2. Die Sprungfunktion und lineare Entscheidungen
  3. Ein Perzeptron von Grund auf programmieren
  4. Das XOR-Problem: Warum ein Neuron nicht genügt
← Zurück zu Deep Learning Academy