This repository contains the C++ code for a Kohonen Self-Organising map, developed for use with a face recognition project done during my final year of bachelor's at College of Engineering Trivandrum.
There are two files in this repository: the cpp code file and the header file used for declarations.
To train the KSOM, the parameters of the network can be set in the .hpp file. Initialisation of the KSOM weight matrix to non-zero values can be achieved by using the load_weight_matrix function. Training iterations are run one at a time by specifying the learning rate and neighbourhood radius for the iteration. Additional functions have to be written for the same.
The simple training algorithm used can be found on Wikipedia. Distance of neighbours from BMU is taken to be 1.