Question

Since I'm new to neural network, there is a few questions I would like to ask to understand it more clearly.

  • Q1: I would like to test for true/false results (pattern recognition), so does it mean that my output layer will have 2 neutrons?
  • Q2: Continue to question 1, if in the training data, it only contains true data, so all the result in testing data will always be true? (Since I'm having this problem, and the Encog library does not allow me to specify two output neutrons since I only have 1 type of output in the training data).

My training data:

1,2,3,4 Pattern1
6,7,8,9 Pattern1

My testing data:

4,3,2,1 Pattern2

This is the result I got from encog: Neural Network Results:

0.0,0.0, actual=-0.05972914453206861,ideal=1.0

Can someone please show me where was I wrong ?
Thank you very much.

Was it helpful?

Solution

If you only need a true/false response, your output layer should only have one neuron. If that one neuron is active, treat that as true. If it is not active, treat that as false.

If your training data only has true values then it is bad data, and won't really help. You will just end up training your network to always respond with true. Perhaps you should figure out some data that should lead to a false result and add it to the training data.

If you training data only has two cases, and they are both true, your network really isn't going to learn anything. You need a lot more data to make the pattern clear.

Go ask a smart person (the best neural networks we've got) the following question:

1,2,3,4 is true; 6,7,8,9 is true. Is 4,3,2,1 true?

They would have no idea. I don't know. No one knows. I don't know what the criteria is. It could be any number of things that determines whether the sequence is true. Including:

  • the numbers are going up
  • they move in the same direction
  • they are always one apart
  • that all the numbers are under 10

I have no idea which of these are requirements and which aren't. No idea. And the neural network you are making will have even less of an idea.

The main problem is that you need more data.

One last note. It is often said that neural networks are good at 'pattern matching'. And that is true. However, sequences of numbers aren't usually what is meant by 'pattern matching'. Anything that requires arithmetic isn't really going to be well served by a neural network. They aren't exact enough for arithmetic. So you are never going to be able to train a neural network particularly well to, for example, identify a sequence of doubling numbers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top