📡

Radial Basis Function Networks Intermediate

Hidden units that fire based on distance to a centre. Live visualiser plus a JavaScript implementation of Gaussian RBF units.

4 lessons 12 quiz questions ⚡ Live compiler
Lessons & quizzes Compiler Certificate

📚 Lessons & quizzes

Each lesson ends with its own short quiz. Answer them as you go — score 90% across all lessons to earn your certificate.

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.

2 The Gaussian basis function

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

3 Output layer and training

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);
}

4 Where RBF networks fit

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.

⚡ Radial Basis Function Networks Compiler

Code runs live in a sandboxed frame, rendered by your browser.

JS

            

🎓 Certificate of Completion

🔒 Complete every lesson quiz above with 90%+ to unlock your downloadable certificate.