1 What makes an RBF network different
A Radial Basis Function network has one hidden layer whose units respond to how close the input is to a stored centre, not to a weighted sum. Drag the input point below and watch which Gaussian units light up.
Hidden units that fire based on distance to a centre. Live visualiser plus a JavaScript implementation of Gaussian RBF units.
Each lesson ends with its own short quiz. Answer them as you go — score 90% across all lessons to earn your certificate.
A Radial Basis Function network has one hidden layer whose units respond to how close the input is to a stored centre, not to a weighted sum. Drag the input point below and watch which Gaussian units light up.
The usual basis is a Gaussian: φ(x) = exp(−‖x − c‖² / 2σ²), where c is the centre and σ the width. Output is a simple weighted sum of these activations — linear in the weights, which makes training fast.
function rbf(x, center, sigma) {
let d2 = 0;
for (let i = 0; i < x.length; i++) d2 += (x[i] - center[i]) ** 2;
return Math.exp(-d2 / (2 * sigma * sigma));
}
console.log(rbf([0, 0], [0, 0], 1)); // 1 (at the centre)
console.log(rbf([2, 0], [0, 0], 1)); // smaller, farther away
The output is y = Σ wᵢ φᵢ(x). With centres fixed (often chosen by clustering the data), only the output weights remain — and they can be solved directly with linear least squares, no slow gradient descent needed.
function rbfNet(x, centers, sigma, weights) {
const phi = centers.map(c => rbf(x, c, sigma));
return phi.reduce((s, p, i) => s + weights[i] * p, 0);
}
RBF networks are strong at interpolation and fast function approximation, and they give a sense of locality — far-from-any-centre inputs produce weak activations, a useful signal for novelty detection. They scale poorly when many centres are needed in high dimensions.
Code runs live in a sandboxed frame, rendered by your browser.
🔒 Complete every lesson quiz above with 90%+ to unlock your downloadable certificate.
Congratulations! Enter your name to generate your certificate.