Neural NetworksIntroduction
For decades, people tried to write intelligence down as rules: thousands of "if this, then that" lines for playing chess, recognising faces or driving a car. The rules were rigid and broke easily. Neural networks took another road: instead of writing the rules, we let the machine learn them from examples. The chatbots and image makers you may have used are giant neural networks — and every one of them is built from one tiny part, the neuron.
Remember Riya's kulfi cart from Linear Regression? Her model was a straight line, . A neuron is that same line with one extra step at the end.
A neuron multiplies each of its inputs by a weight, adds them up together with a bias, and passes the total through an activation function. Riya's neuron decides whether to open her cart:
The input holiday is 1 on a holiday and 0 on a school day, and is the S-shaped sigmoid from Logistic Regression. When the chance is 0.5 or more, Riya opens the cart. The blue inputs flow along the purple weights into the neuron. Under it, the chart shows the chance for every temperature: the solid curve for a school day and the dashed one for a holiday. Change the day and complete both missions.
Temperature:
The weights tell the story. Each extra degree adds 0.5 to ; a holiday takes 2 away, which is worth 4 degrees of heat. On a 34 °C holiday,
Understanding The "Network"
One neuron can only weigh up its inputs and make one simple decision. The power of a network comes from teamwork. Think of a factory assembly line: one team checks the parts, the next builds the frame, the next fits the wheels, and a finished car rolls out at the end. In a neural network, numbers enter at the input layer, pass through one or more hidden layers of neurons, and leave at the output layer. Each neuron does a small calculation on the outputs of the layer before it and passes its own answer on. A network with many hidden layers is called deep — hence the name deep learning.
What does a single artificial neuron really do?
Building the assembly line
To see how neurons work together, we need a way to draw their calculations step by step. That drawing is called a computational graph.