Skip to content

Description of neural network file format #3

@oGkgN

Description

@oGkgN

Hi,

please provide a description of the .nnet format used by the various nnet/ACASXU_*.nnet files (which can be used as a reference for implementing custom parsers). I tried to figure out the format by reading the implementation of nnet/nnet.cpp, but I struggle at the part »load Min and Max values of inputs«.
Consider the first 5 non-comment lines of the file nnet/ACASXU_run2a_1_1_batch_2000.nnet:

7,5,5,50,
5,50,50,50,50,50,50,5,
0,
0.0,-3.141593,-3.141593,100.0,0.0,0.0,-3.0,
60760.0,3.141593,3.141593,1200.0,1200.0,100.0,3.0,

My observation so far is the following:
The first line contains (in that order) the number of layers [excluding the input layer] (7), the number of inputs/size of input layer (5), the number of outputs/size of output layer (5) and the size of the biggest layer of that network (50).
The next line provides the precise sizes of every (including the one for input) layer.
In the third line we have the 0/1 boolean value marking the network as symmetric/not symmetric.
But now I'm struggling: Considering this block of code from nnet/nnet.cpp

//Load Min and Max values of inputs
nnet->mins = new double[(nnet->inputSize)];
line = fgets(buffer,bufferSize,fstream);
record = strtok(line,",\n");
for (i = 0; i<(nnet->inputSize); i++)
{
    nnet->mins[i] = atof(record);
    record = strtok(NULL,",\n");
}

nnet->maxes = new double[(nnet->inputSize)];
line = fgets(buffer,bufferSize,fstream);
record = strtok(line,",\n");
for (i = 0; i<(nnet->inputSize); i++)
{
    nnet->maxes[i] = atof(record);
    record = strtok(NULL,",\n");
}

I expect the fourth and fifth line of have only 5 values, since the number of inputs is 5. Also, only five values are stored in the arrays mins and maxes. What am I missing? Might this even be a bug?

Kind regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions