Figure 6.1: The Structure of the Neural Network Library.
To develop the modular neural network first a library was written. All the important functions and objects are included in this library. The structure of the classes used in the modular network is shown in Figure 6.1. As it can be seen from the names in the diagram the classes represent concrete object like cells, layers, etc. This way of structuring was preferred over the usage of more abstract objects like vector or matrix; in my opinion the usage of concrete objects makes it easier to use the library as a kind of construction kit.
The concept of containment of simple object within a complex object was used as the main design method, Figure 6.1(a). Inheritance was used to provide all objects with some general functions, Figure 6.1(b).
One problem with using C was the garbage collection; there is no built-in mechanism to support this. In the high-level interface this problem does not appear to the user of the library, but in the low-level interface this is an important point. In the whole implementation the following convention is made to solve this problem: the user of a low-level methods has to allocate the memory for the return values; and he is also responsible for freeing this memory again. This convention is very common in C programming.
To give an overview the used data structures and classes are described below. For the more important object some parts of the interface are explained.