@@ -58,7 +58,7 @@ <h3>Maven POM</h3>
5858 <dependency>< br />
5959 <groupId>org.aika-software</groupId>< br />
6060 <artifactId>aika</artifactId>< br />
61- <version>1.1 .0</version>< br />
61+ <version>1.3 .0</version>< br />
6262 </dependency>< br />
6363 </ b >
6464 </ p >
@@ -80,7 +80,7 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
8080 HashMap<String, Neuron> inputNeurons = new HashMap< > ();
8181
8282 for(String word: new String[] {"jackson", "cook"}) {
83- Neuron in = m.createNeuron("W-" + word);
83+ Neuron in = m.createNeuron("W-" + word, INPUT );
8484
8585 inputNeurons.put(word, in);
8686 }
@@ -93,9 +93,9 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
9393 < div class ="prettyprint-code ">
9494 < pre class ="prettyprint ">
9595 < code class ="language-java ">
96- Neuron forenameCategory = m.createNeuron("C-forename");
97- Neuron surnameCategory = m.createNeuron("C-surname");
98- Neuron inhibitingN = m.createNeuron("INHIB");
96+ Neuron forenameCategory = m.createNeuron("C-forename", INHIBITORY, LIMITED_RECTIFIED_LINEAR_UNIT );
97+ Neuron surnameCategory = m.createNeuron("C-surname", INHIBITORY, LIMITED_RECTIFIED_LINEAR_UNIT );
98+ Neuron inhibitingN = m.createNeuron("INHIB", INHIBITORY, LIMITED_RECTIFIED_LINEAR_UNIT );
9999 </ code >
100100 </ pre >
101101 </ div >
@@ -114,10 +114,8 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
114114 < pre class ="prettyprint ">
115115 < code class ="language-java ">
116116 Neuron cookSurnameEntity = Neuron.init(
117- m.createNeuron("E-cook (surname)"),
117+ m.createNeuron("E-cook (surname)", EXCITATORY, RECTIFIED_HYPERBOLIC_TANGENT ),
118118 6.0, // adjusts the bias
119- RECTIFIED_HYPERBOLIC_TANGENT,
120- EXCITATORY,
121119 new Synapse.Builder() // Requires the word to be recognized
122120 .setSynapseId(0)
123121 .setNeuron(inputNeurons.get("cook"))
@@ -165,8 +163,6 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
165163 Neuron.init(
166164 forenameCategory,
167165 0.0,
168- RECTIFIED_LINEAR_UNIT,
169- EXCITATORY,
170166 new Synapse.Builder() // In this example there is only one forename considered.
171167 .setSynapseId(0)
172168 .setNeuron(jacksonForenameEntity)
@@ -180,8 +176,6 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
180176 Neuron.init(
181177 surnameCategory,
182178 0.0,
183- RECTIFIED_LINEAR_UNIT,
184- EXCITATORY,
185179 new Synapse.Builder()
186180 .setSynapseId(0)
187181 .setNeuron(cookSurnameEntity)
@@ -204,8 +198,6 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
204198 Neuron.init(
205199 inhibitingN,
206200 0.0,
207- RECTIFIED_LINEAR_UNIT,
208- INHIBITORY,
209201 new Synapse.Builder().setNeuron(cookProfessionEntity)
210202 .setSynapseId(0)
211203 .setWeight(1.0)
@@ -279,23 +271,27 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
279271 < pre class ="prettyprint ">
280272 < code class ="language-java ">
281273
282- Activation ID - Final Decision - Slots | Identity - Neuron Label - Logic Layer - Upper Bound -
274+ Activation ID - Neuron Type - Final Decision - Slots (Ranges) | Identity - Neuron Label - Logic Layer - Upper Bound -
283275Value | Sum | Weight - Input Value | Target Value
284276
285- ...
286- 3 - SELECTED - (0:4, 1:12) () - C-forename - OR[] - V:1.0 Net:1.0 W:0.0
287- 4 - SELECTED - (0:4, 1:12) () - INHIB - OR[] - V:1.0 Net:1.0 W:0.0
288- 1 - SELECTED - (0:4, 1:12) () - W-jackson - OR[] - V:1.0 Net:0.0 W:0.0 - IV:1.0
289- 2 - SELECTED - (0:4, 1:12) () - E-jackson (forename) - V:1.0 Net:6.0 W:6.0
290- 5 - EXCLUDED - (0:4, 1:12) () - E-jackson (city) -
291- 8 - SELECTED - (0:12, 1:17) () - C-surname - OR[] - V:1.0 Net:1.0 W:0.0
292- 9 - SELECTED - (0:12, 1:17) () - INHIB - OR[] - V:1.0 Net:1.0 W:0.0
293- 6 - SELECTED - (0:12, 1:17) () - W-cook - OR[] - V:1.0 Net:0.0 W:0.0 - IV:1.0
294- 7 - SELECTED - (0:12, 1:17) () - E-cook (surname) - V:1.0 Net:8.0 W:8.0
295- 10 - EXCLUDED - (0:12, 1:17) () - E-cook (profession) -
296- ...
297-
298- Final SearchNode:8 WeightSum:13.999
277+ 0 INPUT - - (0:0, 1:4) "mr. " () - W-mr. - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
278+ 4 INHIBITORY - - (0:4, 1:12) "jackson " () - C-forename - V:1.0 UB:1.0 Net:1.0 W:0.0
279+ 5 INHIBITORY - - (0:4, 1:12) "jackson " () - INHIB - V:1.0 UB:1.0 Net:1.0 W:0.0
280+ 1 INPUT - - (0:4, 1:12) "jackson " () - W-jackson - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
281+ 2 EXCITATORY - SELECTED - (0:4, 1:12) "jackson " () - E-jackson (forename) - V:1.0 UB:1.0 Net:6.0 W:6.0
282+ 3 EXCITATORY - EXCLUDED - (0:4, 1:12) "jackson " () - E-jackson (city) - V:0.0 UB:0.0 Net:-95.0 W:0.0
283+ 9 INHIBITORY - - (0:12, 1:17) "cook " () - C-surname - V:1.0 UB:1.0 Net:1.0 W:0.0
284+ 10 INHIBITORY - - (0:12, 1:17) "cook " () - INHIB - V:1.0 UB:1.0 Net:1.0 W:0.0
285+ 6 INPUT - - (0:12, 1:17) "cook " () - W-cook - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
286+ 7 EXCITATORY - SELECTED - (0:12, 1:17) "cook " () - E-cook (surname) - V:1.0 UB:1.0 Net:6.0 W:6.0
287+ 8 EXCITATORY - EXCLUDED - (0:12, 1:17) "cook " () - E-cook (profession) - V:0.0 UB:0.0 Net:-95.0 W:0.0
288+ 11 INPUT - - (0:17, 1:21) "was " () - W-was - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
289+ 12 INPUT - - (0:21, 1:26) "born " () - W-born - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
290+ 13 INPUT - - (0:26, 1:29) "in " () - W-in - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
291+ 14 INPUT - - (0:29, 1:33) "new " () - W-new - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
292+ 15 INPUT - - (0:33, 1:38) "york " () - W-york - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
293+
294+ Final SearchNode:6 WeightSum:12.0
299295 </ code >
300296 </ pre >
301297 </ div >
@@ -316,19 +312,17 @@ <h3>Mutual exclusion example</h3>
316312 Model m = new Model();
317313
318314 // Create the input neurons for the network.
319- Neuron inA = m.createNeuron("IN-A");
320- Neuron inB = m.createNeuron("IN-B");
321- Neuron inC = m.createNeuron("IN-C");
315+ Neuron inA = m.createNeuron("IN-A", INPUT );
316+ Neuron inB = m.createNeuron("IN-B", INPUT );
317+ Neuron inC = m.createNeuron("IN-C", INPUT );
322318
323319 // Instantiate the inhibitory neuron. Its inputs will be added later on.
324320 Neuron inhibN = m.createNeuron("INHIB");
325321
326322 // Create three neurons that might be suppressed by the inhibitory neuron.
327323 Neuron pA = Neuron.init(
328- m.createNeuron("A"),
324+ m.createNeuron("A", EXCITATORY ),
329325 3.0,
330- RECTIFIED_HYPERBOLIC_TANGENT,
331- EXCITATORY,
332326 new Synapse.Builder()
333327 .setSynapseId(0)
334328 .setNeuron(inA)
@@ -352,10 +346,8 @@ <h3>Mutual exclusion example</h3>
352346 );
353347
354348 Neuron pB = Neuron.init(
355- m.createNeuron("B"),
349+ m.createNeuron("B", EXCITATORY ),
356350 5.0,
357- RECTIFIED_HYPERBOLIC_TANGENT,
358- EXCITATORY,
359351 new Synapse.Builder()
360352 .setSynapseId(0)
361353 .setNeuron(inB)
@@ -379,10 +371,8 @@ <h3>Mutual exclusion example</h3>
379371 );
380372
381373 Neuron pC = Neuron.init(
382- m.createNeuron("C"),
374+ m.createNeuron("C", EXCITATORY ),
383375 2.0,
384- RECTIFIED_HYPERBOLIC_TANGENT,
385- EXCITATORY,
386376 new Synapse.Builder()
387377 .setSynapseId(0)
388378 .setNeuron(inC)
@@ -409,8 +399,6 @@ <h3>Mutual exclusion example</h3>
409399 Neuron.init(
410400 inhibN,
411401 0.0,
412- RECTIFIED_LINEAR_UNIT,
413- INHIBITORY,
414402 new Synapse.Builder()
415403 .setSynapseId(0)
416404 .setNeuron(pA)
@@ -443,10 +431,9 @@ <h3>Mutual exclusion example</h3>
443431 .setRelation(EQUALS)
444432 );
445433
446- Neuron outN = Neuron.init(m.createNeuron("OUT"),
434+ Neuron outN = Neuron.init(
435+ m.createNeuron("OUT", EXCITATORY),
447436 0.0,
448- RECTIFIED_HYPERBOLIC_TANGENT,
449- EXCITATORY,
450437 new Synapse.Builder()
451438 .setSynapseId(0)
452439 .setNeuron(pB)
@@ -486,17 +473,17 @@ <h3>Mutual exclusion example</h3>
486473
487474 < pre class ="prettyprint ">
488475 < code class ="language-java ">
489- Activation ID - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
476+ Activation ID - Neuron Type - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
490477 Value | Net | Weight - Input Value | Target Value
491478
492- 0 - SELECTED - (0:0, 1:1) () - IN-A - V:1.0 Net:0.0 W:0.0 - IV:1.0
493- 3 - SELECTED - (0:0, 1:1) () - IN-B - V:1.0 Net:0.0 W:0.0 - IV:1.0
494- 6 - SELECTED - (0:0, 1:1) () - IN-C - V:1.0 Net:0.0 W:0.0 - IV:1.0
495- 2 - SELECTED - (0:0, 1:1) () - INHIB - V:1.0 Net:1.0 W:0.0
496- 1 - EXCLUDED - (0:0, 1:1) () - A -
497- 4 - SELECTED - (0:0, 1:1) () - B - V:1.0 Net:5.0 W:5.0
498- 7 - EXCLUDED - (0:0, 1:1) () - C -
499- 5 - SELECTED - (0:0, 1:1) () - OUT - V:0.762 Net:1.0 W:0.0
479+ 0 INPUT - - (0:0, 1:1) "f" () - IN-A - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
480+ 3 INPUT - - (0:0, 1:1) "f" () - IN-B - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
481+ 6 INPUT - - (0:0, 1:1) "f" () - IN-C - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
482+ 2 INHIBITORY - - (0:0, 1:1) "f" () - INHIB - V:1.0 UB :1.0 Net:1.0 W:0.0
483+ 1 EXCITATORY - EXCLUDED - (0:0, 1:1) "f" () - A - V:0.0 UB:0.0 Net:-97.0 W:0.0
484+ 4 EXCITATORY - SELECTED - (0:0, 1:1) "f" () - B - V:1.0 UB :1.0 Net:5.0 W:5.0
485+ 7 EXCITATORY - EXCLUDED - (0:0, 1:1) "f" () - C - V:0.0 UB:0.0 Net:-98.0 W:0.0
486+ 5 INHIBITORY - - (0:0, 1:1) "f" () - OUT - V:0.762 UB :0.762 Net:1.0 W:0.0
500487
501488Final SearchNode:10 WeightSum:5.0
502489 </ code >
@@ -518,16 +505,14 @@ <h3>Pattern matching example</h3>
518505
519506 // Create an input neuron for every letter in this example.
520507 for(char c: new char[] {'a', 'b', 'c', 'd', 'e', 'f'}) {
521- Neuron in = m.createNeuron(c + "");
508+ Neuron in = m.createNeuron(c + "", INPUT );
522509
523510 inputNeurons.put(c, in);
524511 }
525512
526513 Neuron pattern = Neuron.init(
527- m.createNeuron("BCDE"),
514+ m.createNeuron("BCDE", EXCITATORY ),
528515 5.0,
529- RECTIFIED_HYPERBOLIC_TANGENT,
530- EXCITATORY,
531516 new Synapse.Builder()
532517 .setSynapseId(0)
533518 .setNeuron(inputNeurons.get('b'))
@@ -605,15 +590,15 @@ <h3>Pattern matching example</h3>
605590 < div class ="prettyprint-code ">
606591 < pre class ="prettyprint ">
607592 < code class ="language-java ">
608- Activation ID - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
593+ Activation ID - Neuron Type - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
609594Value | Net | Weight - Input Value | Target Value
610595
611- 0 - SELECTED - (0:0, 1:2) () - a - V:1.0 Net:0.0 W:0.0 - IV:1.0
612- 1 - SELECTED - (0:2, 1:4) () - b - V:1.0 Net:0.0 W:0.0 - IV:1.0
613- 5 - SELECTED - (0:2, 1:10) () - BCDE - V:1.0 Net:5.0 W:0.0
614- 2 - SELECTED - (0:4, 1:6) () - c - V:1.0 Net:0.0 W:0.0 - IV:1.0
615- 3 - SELECTED - (0:6, 1:8) () - d - V:1.0 Net:0.0 W:0.0 - IV:1.0
616- 4 - SELECTED - (0:8, 1:10) () - e - V:1.0 Net:0.0 W:0.0 - IV:1.0
596+ 0 INPUT - - (0:0, 1:2) "a " () - a - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
597+ 1 INPUT - - (0:2, 1:4) "b " () - b - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
598+ 5 EXCITATORY - SELECTED - (0:2, 1:10) "b c d e " () - BCDE - V:1.0 UB :1.0 Net:5.0 W:0.0
599+ 2 INPUT - - (0:4, 1:6) "c " () - c - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
600+ 3 INPUT - - (0:6, 1:8) "d " () - d - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
601+ 4 INPUT - - (0:8, 1:10) "e " () - e - V:1.0 UB :1.0 Net:0.0 W:0.0 - IV:1.0
617602
618603 Final SearchNode:1 WeightSum:0.0
619604 </ code >
0 commit comments