A feed-forward neural network is a type of artificial neural network where information flows in one direction only - from input nodes, through hidden layers, to output nodes. There are no cycles or loops in the network.
Architecture
The network consists of layers of interconnected nodes (neurons):
- Input layer: Receives the raw input features
- Hidden layers: One or more intermediate layers that transform the data
- Output layer: Produces the final predictions
Each connection between neurons has an associated weight, and each neuron (except input neurons) has a bias term.
Mathematical Interpretation
For a network with L layers, the computation proceeds as follows:
Forward propagation: For each layer l from 1 to L:
- z^(l) = W^(l) × a^(l-1) + b^(l)
- a^(l) = f^(l)(z^(l))
Where:
- a^(0) = x (the input)
- W^(l) is the weight matrix for layer l
- b^(l) is the bias vector for layer l
- f^(l) is the activation function for layer l
- z^(l) is the pre-activation value
- a^(l) is the post-activation value (output of layer l)
Common activation functions include ReLU (f(x) = max(0,x)), sigmoid (f(x) = 1/(1+e^(-x))), and tanh.
Mathematical effect: A feed-forward network represents a composition of functions. For a 3-layer network:
y = f^(3)(W^(3) × f^(2)(W^(2) × f^(1)(W^(1) × x + b^(1)) + b^(2)) + b^(3))
This composition allows the network to learn complex, non-linear mappings from inputs to outputs. The hidden layers create increasingly abstract representations of the input data.
Training Process
Training involves finding the optimal weights and biases to minimize a loss function. The standard approach is:
1. Initialize parameters: Randomly initialize weights (often using techniques like Xavier or He initialization) and set biases to zero or small values.
2. Forward pass: Compute predictions by passing training examples through the network.
3. Compute loss: Calculate the difference between predictions and true labels using a loss function:
- For regression: Mean Squared Error (MSE) = (1/n)Σ(y_pred - y_true)²
- For classification: Cross-entropy = -Σ(y_true × log(y_pred))
4. Backpropagation: Compute gradients of the loss with respect to all parameters using the chain rule:
- ∂L/∂W^(l) = ∂L/∂z^(l) × (a^(l-1))^T
- ∂L/∂b^(l) = ∂L/∂z^(l)
- ∂L/∂a^(l-1) = (W^(l))^T × ∂L/∂z^(l)
- ∂L/∂z^(l) = ∂L/∂a^(l) ⊙ f'^(l)(z^(l))
Where ⊙ denotes element-wise multiplication and f' is the derivative of the activation function.
5. Parameter update: Update weights and biases using gradient descent:
- W^(l) = W^(l) - α × ∂L/∂W^(l)
- b^(l) = b^(l) - α × ∂L/∂b^(l)
Where α is the learning rate.
6. Iterate: Repeat steps 2-5 for multiple epochs until convergence.
Practical Considerations
Training typically involves additional techniques for better performance:
- Mini-batch gradient descent: Update parameters using small batches of data rather than the entire dataset
- Momentum: Add a fraction of the previous update to smooth optimization
- Adaptive learning rates: Methods like Adam adjust learning rates per parameter
- Regularization: L2 regularization or dropout to prevent overfitting
- Batch normalization: Normalize inputs to each layer to stabilize training
The key insight is that backpropagation efficiently computes all gradients in one backward pass through the network, making it feasible to train networks with millions of parameters. The universal approximation theorem guarantees that a feed-forward network with sufficient width can approximate any continuous function to arbitrary accuracy, though finding the right parameters remains challenging in practice.