ZPĚTBACK

06Neuronová síť kreslí hraniciA neural network draws the boundary

Stejná úloha jako u perceptronu, ale teď neuronů spojíme víc do vrstev. Síť pak umí nakreslit i zakřivenou hranici — kruh, spirálu, kříž. Sleduj, jak se barevná rozhodovací plocha tvaruje během trénování. The same task as the perceptron, but now we connect more neurons into layers. The network can then draw a curved boundary too — a circle, a spiral, a cross. Watch the colored decision surface take shape during training.

Co a jak?What & how?

Co to jeWhat it is Síť propojených neuronů — stejná myšlenka jako perceptron (05), ale neuronů je víc a jsou ve vrstvách. Díky tomu umí nakreslit i zakřivenou hranici, ne jen přímku.A network of connected neurons — the same idea as the perceptron (05), but with more neurons arranged in layers. That lets it draw a curved boundary, not just a straight line.

Co zkusitWhat to try Naklikej body dvou barev (nebo zvol tvar — kruh, kříž, spirálu) a spusť trénink. Sleduj, jak se barevná rozhodovací plocha během učení tvaruje kolem tvých bodů.Click points of two colors (or pick a shape — circle, cross, spiral) and start training. Watch the colored decision surface shape itself around your points as it learns.

Proč je to důležitéWhy it matters Tady se rodí síla neuronových sítí: skládáním jednoduchých neuronů zvládnou složité, nelineární vzory. Je to základní stavební kámen pod vším ostatním v této sérii — i pod ChatGPT.This is where the power of neural networks is born: stacking simple neurons handles complex, non-linear patterns. It is the basic building block under everything else in this series — and under ChatGPT.

architektura sítě — 2 → 12 → 12 → 1 · barva a tloušťka spoje = váha (modrá +, červená −)network architecture — 2 → 12 → 12 → 1 · connection color and thickness = weight (blue +, red −)
epocha:epoch: 0 chyba:loss: přesnost:accuracy:
Klikáním do plochy přidáváš body zvolené barvy (pravé tlačítko myši = červená). Kruh a kříž se síť naučí rychle, spirála je nejtěžší — chce víc trpělivosti.Click on the canvas to add points of the chosen color (right mouse button = red). The network learns circle and cross quickly; the spiral is the hardest — it needs more patience.
matice vah — modrá = kladná, červená = záporná, sytost = velikostweight matrices — blue = positive, red = negative, saturation = magnitude
vstup → 1. skrytá
(12 × 2)
input → 1st hidden
(12 × 2)
1. → 2. skrytá
(12 × 12)
1st → 2nd hidden
(12 × 12)
2. skrytá → výstup
(1 × 12)
2nd hidden → output
(1 × 12)
číselně — skutečné hodnoty vah (zaokrouhleno na 2 desetinná místa)numerically — the actual weight values (rounded to 2 decimal places)
vstup → 1. skrytá (12 × 2)input → 1st hidden (12 × 2)
1. → 2. skrytá (12 × 12)1st → 2nd hidden (12 × 12)
2. skrytá → výstup (1 × 12)2nd hidden → output (1 × 12)
Proč zvládne to, co perceptron neWhy it can do what the perceptron can't

Perceptron uměl jen rovnou čáru. Síť skládá mnoho neuronů ve vrstvách — každý nakreslí jednoduchou čáru a další vrstvy je kombinují do složitějších tvarů. Tak vznikne zakřivená hranice. Učí se zpětným šířením chyby (backpropagation): spočítá se chyba na výstupu a postupně se rozpočítá na všechny váhy, které se trochu posunou. The perceptron could only do a straight line. The network stacks many neurons in layers — each draws a simple line and the next layers combine them into more complex shapes. That's how a curved boundary arises. It learns by backpropagation: the error at the output is computed and gradually distributed across all the weights, which shift a little.

Vrstvy = skládání tvarůLayers = stacking shapes

Skrytá vrstva = sada „čar". Další vrstva je sečte a ohne do křivek. Víc vrstev a neuronů → složitější hranice. A hidden layer = a set of "lines". The next layer sums and bends them into curves. More layers and neurons → more complex boundaries.

BackpropagationBackpropagation

Síť hádá, porovná s pravdou, spočítá chybu a tu „pošle zpět" sítí. Každá váha se posune směrem, který chybu zmenší. Opakuje se to tisíckrát. The network guesses, compares with the truth, computes the error and "sends it back" through the network. Each weight shifts in the direction that reduces the error. This repeats thousands of times.

Nelineární aktivaceNonlinear activation

Mezi vrstvami je „ohýbací" funkce (tanh). Bez ní by i hluboká síť uměla jen přímku — právě ona dovolí zakřivení. Between layers there's a "bending" function (tanh). Without it even a deep network could only do a straight line — it's what allows curvature.

Od hraček k LLMFrom toys to LLMs

Tahle síť má pár desítek vah. Velké modely jich mají miliardy a místo dvou čísel na vstupu zpracovávají text či obraz — princip učení je ale stejný. This network has a few dozen weights. Large models have billions, and instead of two numbers on the input they process text or images — but the learning principle is the same.