i = 0;
while (fscanf(fp, "%f %f %d", &x[i], &y[i], &outputs[i]) != EOF) {
if (outputs[i] == 0) {
outputs[i] = -1;
}
i++;
}
patternCount = i;
I dont understand the meaning of this line from the above code:
if (outputs[i] == 0) {
outputs[i] = -1;
What does it represent. The Output is a matrix or vector.??
The refrence of the code is:
Perceptron learning algorithm not converging to 0
I have a output file that has 3 columns:
1 0 0
0 0 1
0 1 0
So it a vector file??
outputs is defined as a one-dimensional array containing integer values..
Each index in the array can be seen as corresponding to a line read in the data file.
Where if i == 0 then
The wonderful code and information posted by user Amro explain the limits and function of outputs.
Values for outputs in the data file have been assigned one/zero values.
Therefore the code in question checks to see if the value for outputs read in from the file is equal to zero and re-assigns to a -1.