🧠

Feed-Forward Neural Networks Beginner

The foundational network: values flow input → hidden layers → output. Includes a live visualiser and a JavaScript implementation.

5 lessons 15 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 Meet the feed-forward network

A feed-forward neural network (FFNN, or multilayer perceptron) passes values in one direction: from the input layer, through one or more hidden layers, to the output. Move the sliders below and press Run forward pass to watch each layer’s activations appear.

2 Neurons: weights, bias, activation

Each neuron computes a weighted sum of its inputs, adds a bias, then applies an activation function: y = activation(Σ wᵢxᵢ + b). The weights are what the network learns.

// One neuron
function neuron(weights, inputs, bias, act) {
  let sum = bias;
  for (let i = 0; i < weights.length; i++) sum += weights[i] * inputs[i];
  return act(sum);
}
const relu = x => Math.max(0, x);
console.log(neuron([0.5, -0.2], [1, 3], 0.1, relu));

3 The forward pass as matrix math

A whole layer is one matrix–vector product plus a bias, then an activation applied element-wise. Stacking layers chains these operations — exactly what the visualiser computes.

// A dense layer: W (outputs × inputs) times x
function dense(W, x, act) {
  return W.map(row => act(row.reduce((s, w, i) => s + w * x[i], 0)));
}
const tanh = x => Math.tanh(x);
const W1 = [[0.6, -0.3, 0.4], [0.1, 0.5, -0.2]];
const h = dense(W1, [1, 0, 1], tanh);
console.log('hidden:', h);

4 Choosing an activation

Activations add the non-linearity that lets networks model complex relationships. ReLU (max(0,x)) is the default for hidden layers; sigmoid squashes to (0,1) for probabilities; tanh to (−1,1); softmax turns a vector into a probability distribution for classification.

5 Strengths, limits and training

FFNNs are great for fixed-size tabular inputs and as building blocks inside bigger models. They have no notion of order or spatial structure — that is what recurrent and convolutional networks add. Training uses backpropagation with gradient descent to nudge weights toward lower error.

⚡ Feed-Forward Neural 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.