ClassificationSample

Neural network (MLP)

Layers of simple neurons trained by gradient descent, able to learn curved boundaries.

Synthetic data, generated and trained in your browser.

Try this

  1. 01Watch the boundary form while training runs, and the loss curve fall.
  2. 02Set 1 hidden neuron on Circles: a single straight cut cannot enclose the inner ring.
  3. 03Switch to ReLU and press New weights a few times: the boundary is built from straight segments.

How it works

  1. 1Each hidden neuron computes a weighted sum of the inputs and applies a non-linear activation.
  2. 2The output neuron combines the hidden neurons into a probability.
  3. 3Backpropagation computes how each weight affects the loss.
  4. 4Gradient descent nudges every weight, epoch after epoch.

What the controls teach

Hidden neurons
Number of hidden neurons: each adds a direction the boundary can bend along.
Activation
The non-linearity. tanh gives smooth curves; ReLU gives piecewise-straight ones.
Learning rate
Step size of each update. Too high and the loss bounces; too low and training crawls.

Use it when

  • Complex, non-linear patterns with enough data

Avoid it when

  • Small data
  • When individual predictions must be explained

More in Classification