RBF features
RBF features are center-based radial basis functions. In v2, RBF is a FeatureMap, not an activation enum.
Math
Each RBF node computes:
text
φ_i(x) = exp(-||x - c_i||² / (2σ²))where c_i is a center and σ is the shared width.
API
cpp
feature_elm::RbfMap<float> rbfMap(
inputDim,
numCenters,
0.75f,
feature_elm::RbfCenterInit::kKMeans,
42u);
rbfMap.fit(trainData, numSamples);
std::vector<float> features;
rbfMap.transform(trainData, numSamples, &features);Center initialization
| Mode | Behavior | Use |
|---|---|---|
kRandom | Centers are sampled from the data range | Fast, deterministic ablations |
kKMeans | Centers are selected with k-means++ style sampling | Better coverage of data support |
Width selection
- Small
σcreates local, narrow basis functions. - Large
σmakes nodes overlap and behave more globally. - Start near the median nearest-neighbor distance when the scale is unknown.
When to use
- Inputs have meaningful Euclidean geometry.
- Classes form local clusters.
- A single additive ELM layer struggles with concentric or local boundaries.