1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4 <head><title>Dennco - test1</title>
5 <link rel="stylesheet" type="text/css" href="dstyle.css" />
10 <a define="cell" name="cell1">
11 <a parameter="cellcode" href="#PerceptronCellCode"> </a>
12 <a parameter="connection" href="../3/3_a.xhtml#cell1output" receptor="output"></a>
15 <a define="cellcode" name="PerceptronCellCode" type="B">
16 <pre parameter="script">
21 var wights = new Array();
22 var correctedWights = new Array();
24 var correctedU0wight = 0;
25 var units = new Array();
30 for (var r in this.cell.receptors)
32 if (r.match(/^u[0-9][0-9]$/)
34 var index = Number(r.substring(1));
35 this.units[index] = r;
36 this.wights[index] = 0;
37 this.correctedWights[index] = 0;
45 var sum = 1 * u0wight;
46 for (var index in units)
48 sum += this.cell.receptors[units[index]] * wights[index];
50 var output = sum < this.threshold ? 0 : 1;
51 this.cell.axonValue = output;
54 var learn = this.cell.receptors.learn;
55 var exp = this.cell.receptors.expected;
56 var rate = this.cell.receptors.learningRate;
64 var correctionRate = rate * (exp - output);
65 correctedU0wight = u0wight + u0wight * correctionRate;
66 for (var index in units)
68 correctedWights[index] = wights[index] + (wights[index] * correctionRate);