Saturday, April 6, 2013

Perceptron

Perceptron.class


Main Program



Sample Output :


Input Threshold :0.2
Input Alpha :0.1
Input weight1, w1 :0.3
Input weight2, w2 :-0.1
 x1  x2| desired |  w1  w2 |actual | error |  w1 w2 
 ============================================================ 
  0  0 |     0 | 0.3 -0.1 |    0 | 0.0 | 0.3  -0.1
  0  1 |     0 | 0.3 -0.1 |    0 | 0.0 | 0.3  -0.1
  1  0 |     0 | 0.3 -0.1 |    1 | -1.0 | 0.2  -0.1
  1  1 |     1 | 0.2 -0.1 |    0 | 1.0 | 0.3  0.0
 ============================================================ 
  0  0 |     0 | 0.3 0.0 |    0 | 0.0 | 0.3  0.0
  0  1 |     0 | 0.3 0.0 |    0 | 0.0 | 0.3  0.0
  1  0 |     0 | 0.3 0.0 |    1 | -1.0 | 0.2  0.0
  1  1 |     1 | 0.2 0.0 |    1 | 0.0 | 0.2  0.0
 ============================================================ 
  0  0 |     0 | 0.2 0.0 |    0 | 0.0 | 0.2  0.0
  0  1 |     0 | 0.2 0.0 |    0 | 0.0 | 0.2  0.0
  1  0 |     0 | 0.2 0.0 |    1 | -1.0 | 0.1  0.0
  1  1 |     1 | 0.1 0.0 |    0 | 1.0 | 0.2  0.1
 ============================================================ 
  0  0 |     0 | 0.2 0.1 |    0 | 0.0 | 0.2  0.1
  0  1 |     0 | 0.2 0.1 |    0 | 0.0 | 0.2  0.1
  1  0 |     0 | 0.2 0.1 |    1 | -1.0 | 0.1  0.1
  1  1 |     1 | 0.1 0.1 |    1 | 0.0 | 0.1  0.1
 ============================================================ 
  0  0 |     0 | 0.1 0.1 |    0 | 0.0 | 0.1  0.1
  0  1 |     0 | 0.1 0.1 |    0 | 0.0 | 0.1  0.1
  1  0 |     0 | 0.1 0.1 |    0 | 0.0 | 0.1  0.1
  1  1 |     1 | 0.1 0.1 |    1 | 0.0 | 0.1  0.1
 ============================================================ 



you can test it by your self..
i hope you like this souce code...
and please give some comment....
                                                                                                                                                      Created By : Z-man, 2013

No comments:

Post a Comment