-1

I have a question. I have a file with training data set. It looks like:


1 6 4 12 5 5 3 4 1 67 3 2 1 2 1 0 0 1 0 0 1 0 0 1 1

2 48 2 60 1 3 2 2 1 22 3 1 1 1 1 0 0 1 0 0 1 0 0 1 2

4 24 2 34 3 5 3 2 3 31 3 1 2 2 1 0 0 1 0 0 1 0 0 1 1

4 9 4 21 1 3 3 4 3 48 3 3 1 2 1 1 0 1 0 0 1 0 0 1 1

I have a neural network with 24 neurons in input layer, 12 neurons in hidden layer and 2 neurons in output layer.

When I start to train a network - an error appears: The number of input neurons in the ann (24) and data (6) don't match. But why? How you see there are 24 input data! Can you tell me, why this error is appear? Thx!

I use VS 2015, C#, Win forms;

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Blok
  • 1
  • 2

1 Answers1

0

FANN expects training data to be stored in a very particular format, see here.

The first line in the file is a kind of header, consisting of three space-separated numbers: the number of training records, the number of input neurons and the number of output neurons. Subsequent lines alternate input data and output data, so that each pair of lines constitutes a complete training record.

You have not included the header line, but FANN does not know that - so it is assuming that you have one training record, six input neurons and four output neurons. As the number of input neurons in your ANN does not match what it assumes to be the number of input neurons in your training file it is throwing an error.

It would normally then struggle to read the rest of the file anyway as it is not in the expected format.

RPM
  • 1,704
  • 12
  • 15