Multi-Neural-Gas, with Guassian as neighborhoodfunction, a rectangular grid and equally distributed random points drwan from the unit cube as weights. Implemented in python, for a programming assignment of course Technical Neuroal Network.
Simply import function "MultiNeuralGas" from MultiNeuralGas.py
$ python
from MultiNeuralGas import MultiNeuralGas
Now you can use this function with the following definition:
Centers = MultiNeuralGas(M, N, K, Z0, Zend, Width, PartnerSizes, TrainingPatterns, MaxStep, RandomSeed)
Number of partner networks, input dims, and gas neurons.
Learning rule at the first and last iterations, to implement an exponentially decaying learning rate, decaying from Z0 to Zend.
The width of the Gaussian functions.
A list consists of M positive integer values as the number of neurons for each of the partner networks(a total of K Neurons)
A list of P patterns in the form of a list containing N real values as coordinators, Alternatively, the direction of a .dat file in which for each training pattern you must put the coordinate values in order followed by next patterns (lines with # consider as a comment).
The maximum number of iterations in which the model can train.
A random seed used for random initializing and shuffling, to be able to reproduce results.
A list containing K lists as the coordination for each neuron’s center.
Please check "MultiNeuralGas-Test.py" for an example.
Ali Mohammadi
Rozhin Bayati
Best Regards