Implemented adaptation.

This commit is contained in:
Andru Liu
2024-10-08 21:07:25 -07:00
parent c069343e6a
commit 7548c26c04
+9
View File
@@ -63,3 +63,12 @@ double RBFModel::predict(const double* input) {
return output;
}
/**
* @brief Adapt weights based on the error and learning rate.
*/
void RBFModel::adapt(double error, double learningRate, const double* input) {
for (int i = 0; i < numCenters; ++i) {
double influence = gaussian(input, centers[i]); // Calculate influence based on input
weights[i] += learningRate * error * influence; // Update weight based on error and influence
}
}