Neuron Playground
About this app
One artificial neuron: weighted sum, activation, a decision line in the input plane with the w arrow and bias offset; perceptron rule and gradient step solve AND and OR, XOR stays at 75 %.
With explain mode: an AI tutor walks you through the app, points out what matters in the scene and answers your questions.
What an artificial neuron computes
An artificial neuron multiplies each input by a weight, adds everything up with the bias b to the sum s = w₁x₁ + w₂x₂ + b and passes s through an activation f such as sigmoid, tanh, ReLU or a step. The decision boundary s = 0 is always a straight line in the input plane. The weight vector w is perpendicular to it, the bias shifts it in parallel, and its distance from the origin is −b/‖w‖. A single neuron can therefore only separate linearly separable classes.
What the app shows
The app shows the output y as a 3D surface over the plane (x₁, x₂) or as a top view of the input plane. The decision line and the arrow w lie on the floor. Four datasets are available: two point clouds, AND, OR and XOR. A schema traces the calculation from the inputs through weights and sum to the output, optionally with a deliberately rough biological analogy. A query sphere can be dragged across the plane and shows the output at that point.
Things to try
Adjust w₁, w₂ and b and watch the line rotate and shift, while the activation only shapes the height of the surface. Then let the perceptron rule or a gradient step learn, one step at a time or continuously, with a learning rate η between 0.02 and 2. For AND and OR the rule finds a line with 100 %. For XOR it never settles: no line separates the opposite corners, and more than 75 % is impossible.
Frequently asked questions
- What is a perceptron?
- A perceptron is a single artificial neuron with a step function as its activation. It forms a weighted sum of its inputs plus a bias and outputs 1 if the sum is positive, otherwise 0. Its learning rule nudges the decision line towards each misclassified point.
- Why can’t a single neuron solve XOR?
- In XOR the points of the same class sit in opposite corners of the unit square. A single neuron can only draw one straight line as its boundary, and every line leaves at least one of the four points on the wrong side. XOR needs at least one hidden layer.
- What does the bias do in a neuron?
- The bias is a constant added regardless of the inputs. Geometrically it shifts the decision boundary in parallel without changing its direction. Without a bias the boundary would always have to pass through the origin.
- What can I try in this app?
- You set weights, bias and activation, pick one of four datasets and let the neuron learn with the perceptron rule or gradient descent. You see the error or loss per step and find out why XOR gets stuck at 75 %.
Subject: Neural networks
More from Neural networks
- Agent loop
- Attention Visualiser
- Backpropagation — blame in reverse
- Backpropagation: learning from one mistake
- Basin of Attraction
- Your job under AI
- The temperature dial
- Diffusion model — images from noise (3D)
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps