Inside a neural network / 1 of 7

Artificial neural networks

8 minOpening your notebook…

What you’ll learn

  • Explain the main idea of “Artificial neural networks” in your own words.
  • Trace a concrete example and identify the assumptions behind it.
  • Apply the principle in a practice problem and recognize a common failure.

The idea, intuitively

A neural network is a composition of parameterized transformations. Each layer builds features from the previous layer. The brain analogy is limited: these are mathematical functions trained for specific objectives, not biological replicas.

Treat a neural network as a computation graph, not a mysterious black box. Follow a tiny input through each operation and keep track of tensor shapes. Distinguish the forward pass, gradient computation, and optimizer update. These three stages are connected but solve different parts of the learning problem.

Under the hood

Dense layers connect every input to every output. Depth counts successive transformations; width counts units within a layer. Training adjusts weights and biases, while the architecture specifies how computation is organized.

h=σ(Wx+b)h=\sigma(Wx+b)
x holds the inputs, W and b hold the weights and biases, and σ is the activation. The lab uses ReLU in the hidden layer and sigmoid at the output.
A useful caution

A larger network needs suitable data and evaluation; capacity alone is not competence.

A worked example

A 2–3–1 network transforms two inputs into three hidden activations and then one prediction. Hidden units need not correspond to named human concepts.

Follow one hidden unit with inputs [2, 1], weights [0.5, −1], and bias 0.2. Its weighted sum plus bias is 2 × 0.5 − 1 × 1 + 0.2 = 0.2. ReLU keeps 0.2 because it is positive. Increasing the second input to 2 makes the sum −0.8, so ReLU outputs 0. The next layer uses those hidden outputs as its inputs.

How to use this way of thinking

Build intuition with a small calculation before scaling dimensions. Check whether the architecture can represent the desired relationship, then whether optimization can learn it, then whether the learned solution generalizes. A failure in any one of these stages needs a different response.

See the mechanism

Educational simulationRuns in your browser with simplified rules and example settings.
Try this

Set the network to 5 hidden units and both inputs to 0. Which units still have a nonzero activation? Check the bias column in the weights table.

Opening the experiment…

Try it yourself

Count parameters in a 2–3–1 dense network with a bias per non-input unit.

Key takeaways

  • Weights and biases
  • A larger network needs suitable data and evaluation; capacity alone is not competence.
  • Check the assumptions with a small example before applying this idea to a larger system.

Check your understanding

0/2 checked

Use feedback to learn. Quiz scores and lesson completion are tracked separately.

1What changes during ordinary weight training?
2True or false: Architecture specifies the organization of a network’s computation.
Go to lesson completion

Further reading

Original papers and reference material for this school. External resources may be in English and require internet access.

Dive into Deep Learning (opens a new tab)PyTorch: automatic differentiation (opens a new tab)

Finish this lesson

Mark this lesson complete when you’re ready to continue.

Start with a question

Introduction to AIAI FoundationsA brief history of AIAI FoundationsTypes of AIAI FoundationsAI, ML, and deep learningAI FoundationsUnderstanding generative AIAI FoundationsEthics, limitations, and responsibilityAI FoundationsLinear algebra for learning systemsMathematics for AIVectors, matrices, and similarityMathematics for AICalculus: measuring changeMathematics for AIDerivatives and gradientsMathematics for AIProbability and statisticsMathematics for AIOptimization and objectivesMathematics for AI
K to open · Escape to close