The input is the feature vector.
The first layer has a node for each observation in the training set.
In each node, the value is the distance from the input to the comparator.
This can be calculated using Gaussian distribution, or another method.
One neuron for each category.
We map from the pattern layer to the summation layer according to the actual label of each training item.
Ie, if a sample is red, it will be fed only to the red neuron.
The values are summed.
Largest value is selected.