Braj Kishore
JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
Say hi

Hiring · Building · Investing

Have a system — or a team —that needs to scale?

info@avyxon.ai

Usually replies within a day · track record here

JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
LinkedInXYouTubeSubstackInstagramThreadsFacebookDiscordGitHubTopmate
© 2026 Braj Kishore · Bengaluru, INThink Big · Start Small · Scale Fast
ML Foundations
03Track 2 · The training loop

One neuron

Weights, bias and activation — the three-part unit that every network is a pile of, and the reason a pile of linear layers is still just one linear layer.

45 min2 interactives5 sources

Predict a house price from three numbers: floor area, age, distance to the station. Multiply each by a number you get to choose, add them up, add one more number, and you have a prediction. That is a neuron. Everything else in deep learning is this, arranged.

The intuition

A neuron is a weighted vote followed by a decision about whether to speak up. The weights are how much each voter's opinion counts, the bias is how easily the neuron is convinced at all, and the activation is the rule for turning the tally into a signal worth passing on.

Unlearn this

That a neuron resembles a biological neuron in any load-bearing way. It doesn't. It's a dot product and a squashing function. The metaphor got the field started in 1943 and has been misleading people ever since — 'artificial neural network' is a historical name, not a claim about brains.

01The unit: a dot product, a shift, a squash

A neuron takes a vector of inputs, multiplies each by a learned weight, sums them, adds a learned bias, and passes the result through a non-linear activation function. Two lines of maths that you should be able to write from memory.

For the house: area 120 m², age 8 years, distance 600 m. Weights of +2400, −1500 and −3 respectively say 'each extra square metre adds £2,400; each year of age costs £1,500; each metre from the station costs £3'. That is what a weight is — a learned sensitivity, the partial derivative of the output with respect to one input.

The bias is the intercept: the output when every input is zero. Drop it and you force every decision boundary through the origin, which is a real and unnecessary constraint. It costs one parameter per neuron and it is almost never worth removing.

z = w·x + b = Σᵢ wᵢxᵢ + b

The pre-activation. A dot product plus a shift — one multiply-accumulate per input.

a = σ(z)

The activation. Without a non-linear σ here, depth buys you nothing at all.

But what is a neural network? (Chapter 1)3Blue1Brown

Try it

One neuron, three inputs

Move the weights and watch w·x + b add up. Then let gradient descent set them for you.

02Why the non-linearity is the whole point

This is the single most-asked conceptual question about neural networks, so be able to prove it rather than assert it. Compose two linear layers: a = W₂(W₁x + b₁) + b₂ = (W₂W₁)x + (W₂b₁ + b₂). The product W₂W₁ is just another matrix and the bracket is just another vector. A hundred stacked linear layers collapse into a single linear layer — same expressive power as logistic regression, a hundred times the compute.

Insert a non-linear function between layers and the collapse becomes impossible. Now each layer can bend the space its predecessor produced, and the composition can represent curved, disjoint, wildly non-linear decision boundaries. Depth stops being decorative and starts buying representational power.

That is also the answer to 'why couldn't a perceptron learn XOR?' — a single linear boundary cannot separate the XOR classes, no matter how you set the weights. One hidden layer with a non-linearity can, by first building intermediate features (roughly 'A or B' and 'not both') and then combining them.

In an interview

"What happens if you use no activation function?" — Don't just say 'it becomes linear'. Show the algebra: W₂(W₁x+b₁)+b₂ = (W₂W₁)x + (W₂b₁+b₂). One matrix. That collapse is the proof.

The Essential Main Ideas of Neural NetworksStatQuest with Josh Starmer

03The activation zoo, and which one to actually use

Sigmoid squashes to (0,1) and was the default until roughly 2011. Its derivative peaks at 0.25 and approaches zero at both tails, so gradients shrink by at least a factor of four per layer — the arithmetic origin of vanishing gradients in deep sigmoid networks. Today it survives as the output activation for binary classification, and inside LSTM gates where a 0–1 'how much to let through' is exactly what you want.

Tanh is a rescaled sigmoid that is zero-centred, which makes optimisation better behaved than sigmoid, with a derivative peaking at 1.0. Still saturating, still not the default for deep stacks.

ReLU — max(0, z) — was the practical unlock. Its gradient is exactly 1 for positive inputs, so it doesn't attenuate the signal on the way back, and it's a single comparison to compute. AlexNet credited it for a several-times speedup in training. Its failure mode is the dying ReLU: a unit pushed permanently negative outputs zero, receives zero gradient, and never recovers. Leaky ReLU and its relatives give a small negative slope so there's always a path back.

GELU and SiLU/Swish are the smooth modern defaults inside transformers — ReLU-shaped but differentiable everywhere and empirically a little better at scale.

Softmax is different in kind: it's applied to a whole output vector, exponentiating and normalising so the result is a probability distribution over classes. It's the standard final layer for multi-class classification and the thing an LLM applies over its vocabulary before sampling a token.

TensorFlow PlaygroundGoogle

Try it

The activation zoo

The function on the left, its derivative on the right. The derivative is the half that decides whether a deep network trains.

04From one neuron to a layer: it's a matrix multiply

Put n neurons side by side, each seeing the same input vector, and their weights stack into a matrix. The layer's output is Wx + b, a matrix-vector product. Batch m examples together and it becomes XWᵀ + b, a matrix-matrix product.

That is the entire reason GPUs took over machine learning. A GPU is a machine for doing thousands of independent multiply-accumulate operations at once, which is precisely the shape of a dense layer, a convolution and an attention head. The mathematics of neural networks had been sitting in journals since the 1980s; the hardware that made it economical arrived in the 2000s, and the field turned over within a few years of someone connecting the two.

Z = XWᵀ + b

X is (batch × features), W is (units × features). One GEMM per layer — the operation GPUs are built for.

Neural Networks Part 1: Setting up the ArchitectureStanford CS231n
The vocabulary, defined once
Weight
A learned sensitivity: how much this input moves the output. Formally the partial derivative of output w.r.t. that input in a linear unit.
Bias
The learned intercept. Lets the decision boundary sit anywhere instead of being pinned through the origin.
Activation function
The non-linearity between layers. Without it any depth of network collapses to a single linear map.
ReLU
max(0, z). Gradient of exactly 1 when active, so it doesn't attenuate backprop. Fails by dying — permanently negative units get zero gradient forever.
Softmax
Turns a vector of scores into a probability distribution. The output layer of every multi-class classifier and every LLM's vocabulary head.
Parameters vs hyperparameters
Parameters (weights, biases) are learned by gradient descent. Hyperparameters (learning rate, layer count, batch size) are chosen by you and tuned on validation.

The lab

Everything above, with the dials exposed. Break it deliberately — the failure modes are where the understanding is.

Try it

One neuron, three inputs

Move the weights and watch w·x + b add up. Then let gradient descent set them for you.

Try it

The activation zoo

The function on the left, its derivative on the right. The derivative is the half that decides whether a deep network trains.

What they actually ask

One neuron — the interview questions

QWalk me through what a single neuron computes.Answer it out loud first, then open this

Element-wise multiply the input vector by a learned weight vector, sum, add a bias — that's the pre-activation z = w·x + b — then apply a non-linear activation. The weights are learned sensitivities, the bias is an intercept, and the non-linearity is what lets stacked layers represent more than a straight line.

QSigmoid, tanh or ReLU for hidden layers — which and why?Answer it out loud first, then open this

ReLU or a smooth variant like GELU. Sigmoid's derivative maxes out at 0.25, so gradients shrink at least four-fold per layer and deep stacks stop learning; tanh is better because it's zero-centred but still saturates. ReLU's gradient is 1 in the active region, so the signal survives depth, and it's cheap. I'd keep sigmoid for a binary output and for gating inside an LSTM.

What they're listening for
Quoting the 0.25 derivative peak is the detail that separates memorised answers from understood ones.

QHow many parameters are in a dense layer with 512 inputs and 256 units?Answer it out loud first, then open this

512 × 256 weights plus 256 biases = 131,328. Worth doing out loud — interviewers use this to check you can reason about model size and memory before you reach for a profiler.

Before you move on

Recall beats re-reading, every time. Answer before you flip.

One neuron · self-test1 / 3

Why can't you build a deep network out of linear layers alone?

Go to the primary sources

Where each claim above comes from. Open them alongside the lesson rather than after it — the papers are shorter than you think, and the figures usually carry the whole argument.

Watch
  • But what is a neural network? (Chapter 1)3Blue1BrownThe canonical visual explainer. Nineteen minutes and you will never again think of a weight as an abstraction.
  • The Essential Main Ideas of Neural NetworksStatQuest with Josh StarmerBuilds a network by hand from bent, stretched activation curves — the best intuition for why the non-linearity is what creates shape.
Docs
  • Neural Networks Part 1: Setting up the ArchitectureStanford CS231nThe course notes that taught a generation. Includes the activation-function comparison and the dying-ReLU discussion in proper detail.
Play with it
  • TensorFlow PlaygroundGoogleAdd layers, switch activations, watch the decision boundary form in your browser. Try solving the spiral with a linear activation — you can't, and seeing that is worth an hour of reading.
Book
  • Neural Networks and Deep LearningMichael NielsenFree online book that derives everything from the perceptron up, with runnable code. Chapter 1 covers this lesson exactly.

External links open in a new tab. Every URL was reachable when this page was written; links rot, so treat the list as a map rather than a guarantee.

Got it? Tick it off — progress saves on this device.

← PreviousFraming a learning problemNext →Measuring wrongness
One neuron, three inputsz = w·x + b
120 m²floor area+2.168 yrsage−0.08600 mto station−0.12bias +0.90Σ2.86add it all up£286,000predicted priceoff by £83k

The house

The parameters

A weight is a learned sensitivity. Right now this neuron believes each extra square metre is worth £1,800, each year of age is worth £-1,000, and each metre further from the station is worth £-20. That is all a weight ever is — the amount the output moves when one input moves by one unit.

Each edge shows its own contribution — weight × input. The neuron sums them, adds the bias, and that sum is the prediction. Three multiplications and an addition.

The activation zoo — and the derivative that decides everything
Activation
max(0, x)
ReLU — the function
peak = 1.00
Its derivative

Reach for it when

The default hidden-layer activation since 2012. Gradient of exactly 1 when active, so it doesn't attenuate backprop at all, and it's a single comparison to compute.

How it fails

The dying ReLU: a unit pushed permanently negative outputs zero, receives zero gradient and never recovers. A large learning rate can kill a substantial fraction of a layer in one step.

Do the arithmetic once and you never forget it. Backpropagation multiplies by the activation's derivative at every layer. With sigmoid's maximum of 0.25, ten layers attenuate the gradient by at best 0.25¹⁰ ≈ 1 in a million — and that's the best case, at the exact centre of the curve. With ReLU the factor is 1 in the active region, so nothing is lost. That single comparison is most of why deep learning started working in 2012.

The left plot is the function; the right plot is its derivative, which is the number backpropagation multiplies by on the way back. Flat derivative regions are where learning stops.

One neuron, three inputsz = w·x + b
120 m²floor area+2.168 yrsage−0.08600 mto station−0.12bias +0.90Σ2.86add it all up£286,000predicted priceoff by £83k

The house

The parameters

A weight is a learned sensitivity. Right now this neuron believes each extra square metre is worth £1,800, each year of age is worth £-1,000, and each metre further from the station is worth £-20. That is all a weight ever is — the amount the output moves when one input moves by one unit.

Each edge shows its own contribution — weight × input. The neuron sums them, adds the bias, and that sum is the prediction. Three multiplications and an addition.

The activation zoo — and the derivative that decides everything
Activation
max(0, x)
ReLU — the function
peak = 1.00
Its derivative

Reach for it when

The default hidden-layer activation since 2012. Gradient of exactly 1 when active, so it doesn't attenuate backprop at all, and it's a single comparison to compute.

How it fails

The dying ReLU: a unit pushed permanently negative outputs zero, receives zero gradient and never recovers. A large learning rate can kill a substantial fraction of a layer in one step.

Do the arithmetic once and you never forget it. Backpropagation multiplies by the activation's derivative at every layer. With sigmoid's maximum of 0.25, ten layers attenuate the gradient by at best 0.25¹⁰ ≈ 1 in a million — and that's the best case, at the exact centre of the curve. With ReLU the factor is 1 in the active region, so nothing is lost. That single comparison is most of why deep learning started working in 2012.

The left plot is the function; the right plot is its derivative, which is the number backpropagation multiplies by on the way back. Flat derivative regions are where learning stops.