Skip to content Skip to sidebar Skip to footer

Why Is A Simple 2-layer Neural Network Unable To Learn 0,0 Sequence?

While going through the example of a tiny 2-layer neural network I noticed the result that I cannot explain. Imagine we have the following dataset with the corresponding labels: [

Solution 1:

The classification is right as well. You need to understand that the net was able to separate the test set.

Now You need to use an step function to classify the data between 0 or 1.

In your case the 0.5 seems to be a good threshold

EDIT:

You need to add the bias to the code.

# input datasetX = np.array([ [0,0,1],
               [0,0,1],
               [0,1,0],
               [0,1,0]])

# init weights randomly with mean 0weights0 = 2 * np.random.random((3,1)) - 1

Post a Comment for "Why Is A Simple 2-layer Neural Network Unable To Learn 0,0 Sequence?"