Schematic view of a customized neural network
The image above shows all the fundamental NNfw classes that allow the user to create a customized neural network. The arrows (linker objects) also illustrate the information flow with the network:
A fundamental aspect of the NNfw is that neural networks are not implemented as groups of single neurons interconnected (in fact there’s no implementation of a specific class for artificial neurons). Instead the concept of Cluster is used, which focus on groups of artificial neurons that share the same connectivity (Linkers) patterns. [Up]
Input/Output labels: It offers the user the possibility to mark a Cluster as 'input' or/and 'output' of the neural network created. This feature has no consequences whatsoever in the network functionality, but if you mark a Cluster as 'input' or 'output' (or both), you can access them very fast using the methods created with that purpose;
Clusters marked as Input or Output of a BaseNeuralNet
Update order: this is probably the most important feature of BaseNeuralNet class. In order to propagate the inputs to the outputs following the desired sequence of Clusters and Linkers update, the BaseNeuralNet class offers the method update. This method tells to each Cluster and Linker within the container BaseNeuralNet the sequence of updates in run-time. After telling this sequence to the BaseNeuralNet you just need to call the method step in order to propagate the inputs to the outputs. [Up]
Cluster class representation
A Cluster is formed by 3 basic components:
There are different types of Linkers that allow the user to customize the way that the clusters are interconnected and the calculations are made. For instance, the DotLinker and NormLinker types connect all the outputs from the source cluster to all the inputs of the target cluster. Their difference resides on the way they process the information, or in other words, what happens when the network is updated and the inputs are propagated to the output. While the “update()” method in DotLinker performs the dot-product calculation, in NormLinker performs the Euclidian norm calculation.
There are also two other important types of linkers: CopyLinker and SparseMatrixLinker. The first linker copies the outputs of the source cluster to inputs of the target cluster (fundamental if you work with recurrent networks, like the Elman or Jordan), while the second allows for a non-full connection between clusters (some networks or hypothesis require that not all neurons are interconnected; within this class a few methods allow the user to manage this process; this class is an alternative to the full connectivity offered by DotLinker and NormLinker). [Up]