Question

Assume that I have a dataset like this:

[   [0, 0], [0, 1]
    [0, 1], [1, 0]
    [1, 0], [1, 0]
    [1, 1], [0, 1]   ]

actually, y1 = x1 XOR x2, and y2 = not(x1 XOR x2), which seems not strange at all.

With the code provided in Wikipedia, which is written is Python, the training error does not seem to converge.

Why does this happen? Is there no possibility for this dataset to be trained with a (2, 2, 2) BP network? (2, 2, 2) means that the input layer node number, the hidden layer node number and the output layer node number are all 2(except bias node).

Or is there something wrong with the code?

Was it helpful?

Solution

A (2,2,2) neural network can easily be trained for this. I just tried this in Encog, and it trained in the same amount of time as the single output version. Really what you have above is network configured as a one-of-n classification. That is, you have one output neuron for each expected value.

I am not real fluent in Python, but I would guess that it is a problem somewhere in the adaptation of the code. It is not an inherent limitation in the ANN.

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