39 #ifndef KOHONEN_NETWORK_HPP
40 #define KOHONEN_NETWORK_HPP
70 void train(
const std::vector<std::vector<double>> &inputData,
79 int classify(
const std::vector<double> &inputVector);
84 std::vector<std::vector<double>>
108 const std::vector<double> &input_vector,
109 double learning_rate);
118 const std::vector<double> &vec2);
Kohonen Neural Network Cluster Class.
KohonenNet(int inputSize, int mapSize)
Constructor for the KohonenNet class.
void update_weights(int bmu, const std::vector< double > &input_vector, double learning_rate)
Updates the weights of the Kohonen network based on the best matching unit and input vector.
~KohonenNet()
Destructor for the KohonenNet class.
int classify(const std::vector< double > &inputVector)
Classifies a given input vector and returns the index of the best matching unit.
void initialize_weights()
Initializes the weights of the Kohonen network.
double euclidean_distance(const std::vector< double > &vec1, const std::vector< double > &vec2)
Calculates the Euclidean distance between two vectors.
std::vector< std::vector< double > > weights
void train(const std::vector< std::vector< double >> &inputData, int epochs=1000)
Trains the Kohonen network using input data.
int best_matching_unit(const std::vector< double > &input_vector)
Finds the index of the best matching unit (BMU) for a given input vector.
The source C++ openGPMP namespace.