A classical RBF network is almost always described as having:
- Input Layer: Receives the input vector .
- Feature Layer: A non-linear feature map that calculates the activation based on the distance from the input to defined “center” points.
- Output Layer: Computes a simple, weighted linear sum of the feature layer’s outputs.
To compute the function of an RBF network, we define “center points” in the input space: (where ).
The Feature Map (Hidden Layer):
For each center , the neuron computes a component using a Gaussian function:
-
: The center of the receptive field.
-
: The squared Euclidean distance between the input data and the center.
-
: Controls the width (variance) of the receptive field.
-
If the input is exactly equal to the center , the distance is . The math becomes . The neuron outputs its maximum value.
-
As moves further away from , the negative exponent grows larger. approaches .
The Final Output: The network produces its final prediction by calculating the weighted linear combination of all feature maps:
While the Gaussian function is the standard, other mathematical distance functions can be used for the feature mapping, such as:
- Multiquadratics: , where is constant.
- Inverse Multiquadratics: (Where represents the distance )
When the number of RBF centers () is kept strictly smaller than the number of data points () ( ) exact interpolation is impossible. The network must instead find the optimal weights that minimize the overall prediction error.
-
The Objective Function : We define the standard Sum of Squared Errors objective function
-
The hidden layer of an RBF network is non-linear, but the output layer is purely a linear sum, finding these weights is actually much, much easier than Backpropagation
Before we even touch the weights or the objective function, we just look at the raw input data. We use a grouping algorithm (like K-Means Clustering) to find natural “clusters” or hotspots in the data, and we drop a center () in the middle of each cluster.
Assuming we have already chosen our center points (), the task of finding the perfect weights for interpolation can be written as a single matrix multiplication problem.
Let:
- : A column vector containing all the true target measurements .
- : A column vector containing the unknown weights that we need to solve for.
- : The Design Matrix (or Activation Matrix) of size .
The interpolation problem requires us to find a weight vector such that:
The matrix stores the activation value of every hidden neuron for every data point in the training set.
- Rows (Data Points): Each row represents a single test point from the dataset.
- Columns (Hidden Neurons): Each column represents one specific hidden RBF neuron (defined by its center ).
Calculating the optimal weight vector depends entirely on the ratio of training data points () to chosen RBF centers ().
Case 1: T<m (Under-determined)
- The system has fewer equations than unknowns.
- There are infinitely many exact solutions.
Case 2: (Square System / Strict Interpolation)
- The number of data points exactly matches the number of centers. As long as all chosen centers are distinct, matrix is guaranteed to be non-singular (invertible).
- Case 3: (Over-determined / Approximation)
- The system has more data points than centers.
- Matrix is rectangular () and therefore has no standard inverse. Exact interpolation is impossible.
- We must find the weights that minimize the Sum of Squared Errors. We solve this using the Moore-Penrose Pseudo-Inverse ():
The scalar summation form of the error function is:
Using the dot product property of vectors () with error vector be :
- : Column vector of true target values.
- : The RBF activation matrix.
- : Column vector of the unknown weights.
The Necessary Optimality Condition:
Solving for : If the resulting square matrix is invertible
, is known as the Moore-Penrose Pseudo-Inverse (often denoted as ). It allows us to mathematically find the “line of best fit” for a rectangular matrix.
- Singular Value Decomposition: In general, if the matrix is singular one can follow similar approaches to define a pseudo-inverse using the Singular Value Decomposition (SVD) of the matrix.
- Regularization: Another common way to regularize the problem (fix the singularity/instability) is to add a small mathematical penalty to the diagonal of the matrix before inverting it: (Where is the Identity Matrix. In machine learning, this trick is commonly known as Ridge Regression!)
The RBF Learning Algorithm
Choose the Centers ()
- The center points of the hidden neurons must be fixed before weight calculation begins.
- Method: This is usually done using various heuristics. A common, simple approach is to randomly select a subset of the actual test points to serve as the centers. More advanced methods involve clustering algorithms like K-Means.
- Orthogonal Least Squares (OLS) Reduction: (Chen, Billings, Cowan 1989/1991). A forward-selection algorithm that builds the RBF hidden layer iteratively. It selects data points to serve as centers one by one, choosing the point that provides the maximum reduction in the residual error at each step. Gram-Schmidt Orthogonalization: The OLS algorithm orthogonalizes the chosen feature vectors at each step. This guarantees that each newly added center captures unique variance in the data that previous centers failed to explain. Like Principal Component Analysis OLS acts as a dimensionality reduction technique, identifying the most critical “components” (centers) that represent the underlying structure of the data.
Choose the Spread/Width ()
- Once the centers are placed, you must define the variance for each Gaussian receptive field.
- Method: This determines how strongly nearby points activate the neuron. Often, a single global is chosen based on the average distance between the chosen centers.
- The Heuristic:
- $d_{max}$: The maximal Euclidean distance between any two chosen centers in the network.
- $m$: The total number of chosen centers.
Solve for the Weights ()
- With the hidden layer locked, the network must find the optimal linear weights connecting the hidden layer to the output.
- The optimal weights can be found using the Pseudo-Inverse equation (): .
- Computing a matrix inverse is computationally prohibitive (scaling at complexity).
- To avoid computing the inverse, we start with a randomized initial weight vector and use an iterative numerical optimization algorithm (such as Steepest Descent / Least Mean Squares) to approximate .
Orthogonal Least Squares (OLS) algorithm The goal of OLS is to compute an “energy function” (a measure of variance or information) for the network. By evaluating this function, we can determine exactly how much a specific test point contributes to reducing the overall error if it is selected to be a center.
The Pruning Strategy:
- Start by defining the activation matrix as if every single test point is a center (yielding a square matrix).
- Evaluate the energy contribution of each column.
- Systematically remove the columns (centers) that contribute the least energy, reducing the dimension from down to .
For any given choice of weight vector , the network outputs a prediction vector . The difference between the true target values () and the network’s prediction is the error vector ().
- The Subspace: The columns of the design matrix span a specific subspace in . This subspace represents all possible outputs the current RBF network can mathematically generate.
- The Projection (): The optimal network prediction is exactly the orthogonal projection of the true target vector onto the column space of .
- The Error (): Because it is an orthogonal projection, the optimal error vector is perfectly perpendicular (orthogonal) to the column space of .
Because is a projection, we can use the Pythagorean theorem (or Gram-Schmidt orthogonalization) to cleanly separate the “energy” (variance) of into individual chunks provided by each individual column of . We then simply select the centers whose columns provide the largest chunks of energy.
To analytically solve the RBF network without explicitly computing the inverse of the computationally heavy matrix , we use the Gram-Schmidt orthogonalization algorithm to perform a QR Decomposition.
We decompose the activation matrix into two separate matrices:
-
: An orthogonal matrix where every column is pairwise orthogonal to the others.
-
: An upper triangular matrix with entries of on the main diagonal.
(Where , representing the squared norm/energy of each orthogonal vector).
a new intermediate weight vector
To find the optimal vector that minimizes the squared error, we apply the standard pseudo-inverse derivation
is purely diagonal, its inverse is take the reciprocal of the diagonal entries .
Because the columns of () are pairwise orthogonal, the optimal intermediate weight vector can be calculated element by element.
The -th component is computed as:
For the squared error to be truly minimized, the optimal prediction vector () must be perfectly orthogonal to the residual error vector ().
-
Mathematically:
-
Consequence: Their dot product is zero. .
We evaluate the total variance (energy) of the target vector by taking its inner product with itself: .
Since is a diagonal matrix containing elements , the final scalar Energy Equation is:
The total explained variance of the network is the sum of the individual contributions: .
To find the specific variance contribution of a single candidate center , we substitute the known matrix definitions into the term:
Simplifying this expression yields the exact energy contribution formula:
The Orthogonal Least Squares (OLS) algorithm uses this derived metric as its core heuristic for forward selection:
-
Selection: At each step, evaluate the contribution formula for all remaining candidate test points. Select the test point that yields the absolute highest value.
-
Stopping Criteria: The algorithm iteratively adds centers until one of two conditions is met:
-
A pre-determined maximum number of centers () is reached.
-
The cumulative explained variance provides a “reasonable approximation” of the total system variance ().
-
Because the formula relies on the vectors () being orthogonal, adding a new center fundamentally changes the system. When a test point is selected as a center, the Gram-Schmidt algorithm must be applied to orthogonalize all remaining candidate vectors against the newly chosen center. This ensures that the contribution formula only ever measures new, unexplained variance in subsequent steps.