Illustrated Tour

A Look from the Sky

diagramma1.png

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:

  1. BaseNeuralNet: can be seen as a “container” where all the items of your neural network are placed.
  2. Cluster: a group of neurons with common relationships to other objects.
  3. Linker: is an object that implements the connection between two clusters, allowing for the transmission/computation of information from one Cluster object to the other.

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]

The BaseNeuralNet Class

Once Clusters and Linkers are defined created the neural network is already fully functional. So why do we need the BaseNeuralNet “container”? First of all this class was created for the user commodity, in order to improve the usability of big and complex neural networks. But there are a few other features that are worthwhile to mention:

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;

diagramma2.png

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]

Inside a Cluster

diagramma3.png

Cluster class representation

A Cluster is formed by 3 basic components:

  1. Inputs: consist of a RealVec (vector of real) object containing the inputs for the Cluster neurons. These inputs can be set “by hand” (e.g. input layer like Cluster 1 in Fig. 1) or by the Linker objects computations that are fed into the Cluster (e.g. Cluster 4 in Fig. 1).
  2. Outputs: consist of a RealVec object containing the outputs of Cluster neurons. The Cluster outputs can be used directly as the neural network outputs, or instead fed to any Linker (connected to the Cluster output) as an input for their calculations.
  3. OutputFunction: this is the function that governs the information transfer from inputs to outputs within the Cluster object (e.g. linear transformation, logistic, radial-basis and so on). This function dictated the behaviour of the Cluster neurons.
[Up]

Inside a Linker

The class Linker is more abstract than Cluster. It only specifies the source Cluster ('from') and the target ('to') Cluster. The Linker object takes as input the output of the 'from' Cluster, and outputs the result of its calculation to the 'to' Cluster. The Linker object embodies the 'rule' that transforms the Outputs of the 'from' (source) Cluster, into the inputs of 'to' (target) Cluster. They symbolize the neurons axons. For instance, in a feed-forward network, Linkers are just RealMat (matrix of real) objects, which calculate the weighted-sum of the source Cluster outputs, and place the results into the target Cluster neurons inputs.

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]

BerliOS Developer Logo Valid XHTML 1.0 Transitional Valid CSS!