The network file format

A network can be loaded from a file or recorded on a new file. This feature can be used for two reasons: you may want to record the diagram of a net to recall it later on, or you may generate a network by a program, in the case you estimate that this way to edit a net is faster than instantiating nodes and arcs graphically. To create a large net programmatically, one has to edit a file, in the network file format, described hereafter, and then load it with the option LOAD from the application main menu. Any program involving neural network computation can produce an output, that, if represented in this format, can then be visualized by our graphical editor; and viceversa after a computation is performed in the environment, one could be interested in communicating the state of the network to an external program. In the file are specified the state of the net, that is neurons and arcs states, some structural parameters, that is arcs type, and graphical properties such as objects size or position.

The file format foresees a network that can be structured in independent different subnets. Nor the simulator, nor the editor take advantage of the possibility of structuring a net, yet; anyway this feature is already considered in the kernel, that manage the internal structure. Here is an example of a file for a framework of 3 networks (the main net plus 2 subnets); there are some keywords that must be copied unchanged, the parenthesis <> indicate the fields that must be filled in, [] indicate the optional fields, while {} contains comments. Blank spaces and tabs are allowed to separate two fields.


NET 	{first net}
NEURONS
   0 <x-coord> <y-coord> <size> <class> <state> [label]
   1 <x-coord> <y-coord> <size> <class> <state> [label]
   2 <x-coord> <y-coord> <size> <class> <state> [label]
   {until the end of first net neurons}
ARCS
   <start neuron> <end neuron> <type> <weight>
   <start neuron> <end neuron> <type> <weight>
   <start neuron> <end neuron> <type> <weight>
   {until the end of first net arcs}

NET	{second net}
NEURONS
   0 <x-coord> <y-coord> <size> <class> <state> [label]
   1 <x-coord> <y-coord> <size> <class> <state> [label]
   2 <x-coord> <y-coord> <size> <class> <state> [label]
   {until the end of second net neurons}
ARCS
   <start neuron> <end neuron> <type> <weight>
   <start neuron> <end neuron> <type> <weight>
   <start neuron> <end neuron> <type> <weight>
   {until the end of second net arcs}

NET {third net} NEURONS {until the end of third net neurons} ARCS {until the end of third net arcs} END


Where the values to be specified in fields between parenthesis < ;> are the following:
<x-coord>
an unsigned integer number with the x-coordinate (in pixel) of the neuron in the editing area window (note that the top-left corner of the window correspond to (0,0) coordinates, the x increases toward right and the y increases toward bottom);
<y-coord>
the y-coordinate;
<size>
is a number from 0 to 4 that specify a decreasing size for the neuron sphere;
<class>
0 means an input unit, 1 means an output unit and 2 means an hidden unit;
<state>
is a floating point value for the neuron state; the largest representable floating point value depends on the machine, as the best value precision possible;
[label]
an optional text string; the string read has maximum 20 characters, and no space should be inserted.
<start neuron>
is the index of the connection's starting neuron, the first field in each neuron specification line;
<end neuron>
is the index of the connection's ending neuron;
<type>
1 means an antisymmetric connection, 2 a symmetric connection and 3 an oriented connection;
<weight>
is a floating point value for the arc weight.

Back to index