← All Neural Networks & Deep Learning modules

Module 8 — Train a Network End-to-End

Capstone · hands-on · about 30 minutes.

This is the payoff. Across seven modules you built every piece: a neuron, activations to bend the line, a network that wires neurons together, the training loop, backpropagation, depth, and the tools that keep a network honest. Now you put them all in one place. You will pick a dataset, design the architecture, set the learning rate, press Train, and watch a network go from random noise to a working classifier — making every decision yourself.

The whole engine, in your hands

Everything you choose below maps to something you learned:

Then the Train button runs the exact loop from Module 4 — forward, loss, backprop, update — for many epochs, while you watch the loss fall and the boundary form. Your goal: get the validation accuracy as high as you can on each dataset. Try the spiral last; it's the one that needs everything you learned.

This activity needs JavaScript. The lesson below still covers everything.

The full thing in Keras — every choice you just made — read only
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.optimizers import SGD
from tensorflow.keras.regularizers import l2

model = Sequential([
    Dense(16, 'relu', input_shape=(2,), kernel_regularizer=l2(1e-3)),
    Dense(16, 'relu', kernel_regularizer=l2(1e-3)),   # depth + width
    Dense(1,  'sigmoid')                              # output
])
model.compile(optimizer=SGD(0.3), loss='binary_crossentropy',  # η + loss
              metrics=['accuracy'])
model.fit(X, y, validation_split=0.3, epochs=300)         # the loop

That is a complete, real training script — the same network you just trained on the canvas, written the way a practitioner would. You now understand every line of it.

AI anchor — you've trained a neural network The network you just drove from noise to a classifier is, structurally, the same kind of object as the models behind image recognition, recommendation, and language. They are bigger — billions of weights, hundreds of layers, oceans of data — but the loop is the one you just ran: forward, loss, backprop, update. You did not watch deep learning happen; you did it.

Check your understanding

A synthesis quiz spanning the whole course. You will get a score.

This activity needs JavaScript.

Where you go next You now understand how neural networks learn — from a single neuron to a deep, regularized classifier you trained yourself. Course 5 — Inside Large Language Models takes the very same machinery, scales it to billions of weights stacked in transformer blocks, and shows how it turns into a model that reads and writes language. Everything you built here is the foundation it stands on.
One-sentence summary: a neural network learns by repeating one loop — forward pass, loss, backpropagation, weight update — over many epochs; you choose the dataset, the depth and width, the learning rate, and the regularization, and those choices are the entire craft of training the deep models that power modern AI.

← Back to all modules