From c3be2c3010b2738e8b23095526591b0c650a5f5e Mon Sep 17 00:00:00 2001 From: Andru Liu <90433630+WallabyLester@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:10:31 -0700 Subject: [PATCH] Implemented weight grabber. --- CPP_Implementation/rbf_model.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CPP_Implementation/rbf_model.cpp b/CPP_Implementation/rbf_model.cpp index e376f1e..a1b6782 100644 --- a/CPP_Implementation/rbf_model.cpp +++ b/CPP_Implementation/rbf_model.cpp @@ -72,3 +72,12 @@ void RBFModel::adapt(double error, double learningRate, const double* input) { weights[i] += learningRate * error * influence; // Update weight based on error and influence } } + +/** + * @brief Get the weight at a specific index. + */ +double RBFModel::get_weight(int index) const { + if (index < 0 || index >= numCenters) return 0.0; + return weights[index]; +} +