Hello i am learning neural network. is a neuron storing only a value between 1 or -1 ? i cant give value 255 or 1024 like ? i was looking for encog java library XOR function solver example. I wanted to change XOR to Multiplier by changing XOR_INPUT and XOR_IDEAL.
Here is source location: http://www.heatonresearch.com/wiki/Hello_World
I have changed
FROM:
/**
* The input necessary for XOR.
*/
public static double XOR_INPUT[][] = { { 0.0, 0.0 }, { 1.0, 0.0 },
{ 0.0, 1.0 }, { 1.0, 1.0 } };
/**
* The ideal data necessary for XOR.
*/
public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 1.0 }, { 0.0 } };
TO:
/**
* The input necessary for XOR.
*/
public static double XOR_INPUT[][] = { { 0.0, 0.0 }, { 1.0, 0.0 },
{ 1.0, 2.0 }, { 2.0, 4.0 } };
/**
* The ideal data necessary for XOR.
*/
public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 2.0 }, { 8.0 } };
After changing value to these. I got infinite loop and outputs constant:
Epoch #274107 Error:12.75
Epoch #274108 Error:12.75
Epoch #274109 Error:12.75
Epoch #274110 Error:12.75
Epoch #274111 Error:12.75
Epoch #274112 Error:12.75
Epoch #274113 Error:12.75
Epoch #274114 Error:12.75
Epoch #274115 Error:12.75
Epoch #274116 Error:12.75
Epoch #274117 Error:12.75
Epoch #274118 Error:12.75
Epoch #274119 Error:12.75
Here is the questions;
1-)is this called local minima?
2-) do i need to set value between (0 and 1) or (-1 and 1) is a must?
3-) how can i solve simple multiplication solver problem?
Thanks.
Your output layer is sigmoid, which means it can only represent values between 0 and 1, so it is impossible to train such a network to recognize anything else. However, it is not the network falw, you should scale your output so it fits into this interval, and later on descale.
Simply:
Now you train your network, and to retrieve original outputs simply multiply the value by 8.
Remember, that simple neural networks are not tools for symbolic computations. If you are looking for a model which will actually find the a*b
formula then read about symbolic function networks
.