AI-Perceptron

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
TRAINING
    Usually you have to train a perceptron before it will give you the
    outputs you expect. This is done by giving the perceptron a set of
    examples containing the output you want for some given inputs:
 
        -1 => -1, -1
        -1 =>  1, -1
        -1 => -1,  1
         1 =>  1,  1
 
    If you've ever studied boolean logic, you should recognize that as the
    truth table for an "AND" gate (ok so we're using -1 instead of the
    commonly used 0, same thing really).
 
    You *train* the perceptron by iterating over the examples and adjusting
    the *weights* and *threshold* by some value until the perceptron's
    output matches the expected output of each example:
 
        while some examples are incorrectly classified
            update weights for each example that fails

lib/AI/Perceptron.pm  view on Meta::CPAN

244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
Usually you have to train a perceptron before it will give you the outputs you
expect.  This is done by giving the perceptron a set of examples containing the
output you want for some given inputs:
 
    -1 => -1, -1
    -1 =>  1, -1
    -1 => -1,  1
     1 =>  1,  1
 
If you've ever studied boolean logic, you should recognize that as the truth
table for an C<AND> gate (ok so we're using -1 instead of the commonly used 0,
same thing really).
 
You I<train> the perceptron by iterating over the examples and adjusting the
I<weights> and I<threshold> by some value until the perceptron's output matches
the expected output of each example:
 
    while some examples are incorrectly classified
        update weights for each example that fails



( run in 1.437 second using v1.01-cache-2.11-cpan-49f99fa48dc )