# Learning the XOR function

Success in 548 training rounds!

## Result

Testset 0; expected output = (-1) output from neural network = (-0.988156660399)

Testset 1; expected output = (1) output from neural network = (0.991368816456)

Testset 2; expected output = (1) output from neural network = (0.991474739279)

Testset 3; expected output = (-1) output from neural network = (-0.989463625219)

# Playing around...

The following is to show how changing the momentum & learning rate,
in combination with the number of rounds and the maximum allowable error, can
lead to wildly differing results. To obtain the best results for your
situation, play around with these numbers until you find the one that works
best for you.

The values displayed here are chosen randomly, so you can reload
the page to see another set of values...

## Learning rate 1, momentum 0.8 @ (1000 rounds, max sq. error 0.001)

Round 1: No success...

Round 2: No success...

## Learning rate 0.25, momentum 1 @ (2000 rounds, max sq. error 0.05)

Success in 78 training rounds!

Testset 0; expected output = (-1) output from neural network = (-0.934814067601)

Testset 1; expected output = (1) output from neural network = (0.985458796167)

Testset 2; expected output = (1) output from neural network = (0.963517392958)

Testset 3; expected output = (-1) output from neural network = (-0.937238374382)

## Learning rate 0.5, momentum 0.4 @ (100 rounds, max sq. error 0.01)

Round 1: No success...

Round 2: No success...

## Learning rate 0.5, momentum 0.8 @ (100 rounds, max sq. error 0.001)

Round 1: No success...

Round 2: No success...

## Learning rate 0.75, momentum 0.8 @ (100 rounds, max sq. error 0.05)

Round 1: No success...

Round 2: No success...

## Learning rate 1, momentum 0.4 @ (100 rounds, max sq. error 0.05)

Round 1: No success...

Round 2: No success...

## Learning rate 0.25, momentum 0.4 @ (2000 rounds, max sq. error 0.01)

Round 1: No success...

Round 2: No success...

## Learning rate 1, momentum 0.6 @ (2000 rounds, max sq. error 0.05)

Success in 64 training rounds!

Testset 0; expected output = (-1) output from neural network = (-0.978342261661)

Testset 1; expected output = (1) output from neural network = (0.969556594922)

Testset 2; expected output = (1) output from neural network = (0.924649223061)

Testset 3; expected output = (-1) output from neural network = (-0.999718885438)

## Learning rate 0.25, momentum 0.6 @ (500 rounds, max sq. error 0.1)

Round 1: No success...

Round 2: No success...

Success in 59 training rounds!

Testset 0; expected output = (-1) output from neural network = (-0.861768834518)

Testset 1; expected output = (1) output from neural network = (0.958155303061)

Testset 2; expected output = (1) output from neural network = (0.914525743909)

Testset 3; expected output = (-1) output from neural network = (-0.913245473878)

## Learning rate 0.5, momentum 0.8 @ (1000 rounds, max sq. error 0.1)

Round 1: No success...

Round 2: No success...