www.pudn.com > BPËã·¨Ô´Âë.zip > xor.bp


* This is the classic xor problem z = xor(x,y).  X and y are input and 
* z needs to be computed or maybe its more accurate to say the network 
* needs to memorize the output z for each x and y. 
* 
* The learning times vary depending on the initial random weights, the 
* algorithm chosen and all the parameter settings.  The results can also 
* depend ever so slightly on the floating point hardware being used and 
* whether or not the compiler is optimizing.  The file xor.ini contains 
* one set of random weights and the file xorrbp.cpy shows the results 
* for these weights using the rbp program with the standard smooth 
* sigmoid.  The file xorbp.cpy shows the results for these weights using 
* the bp program and the standard smooth sigmoid. 
* 
* The parameter and algorithm settings here are not particularly good so 
* you may want to play around to try and find the best, which as far as 
* I can tell will be around 20 iterations with a failure rate of around 
* 10%. 
 
m 2 1 1 x   * make a 2-1-1 network 
s7          * seed the random number generator 
ci 1        * giving the network a "kick" sets new random weights 
a as        * standard smooth sigmoid 
 
rt {        * there are four patterns following 
1 0 1 
0 0 0 
0 1 1 
1 1 0 } 
 
e 0.5       * set the learning rate, eta to 0.5 
a 0.9       * set the momentum, alpha to 0.9