Skip to content

Commit

Permalink
Release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasMolzberger committed Jul 31, 2019
1 parent 2f4de20 commit afb5618
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 81 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.aika-software</groupId>
<artifactId>aika</artifactId>
<packaging>jar</packaging>
<version>1.2.2-SNAPSHOT</version>
<version>1.3.0</version>
<name>aika</name>
<url>http://aika.network</url>
<description>An artificial intelligence for knowledge acquisition</description>
Expand All @@ -30,7 +30,7 @@
<url>https://github.com/aika-algorithm/aika</url>
<connection>scm:git:git://github.com/aika-algorithm/aika.git</connection>
<developerConnection>scm:git:[email protected]:aika-algorithm/aika.git</developerConnection>
<tag>aika-1.1.0</tag>
<tag>aika-1.3.0</tag>
</scm>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,6 @@ public enum Mode {OLD, NEW}


public void saveState(SearchNode sn) {
currentOption.fixed = true;
currentOption = new Option(currentOption, this, sn);

if (sn.getModifiedActivations() != null) {
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/network/aika/neuron/activation/search/Option.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ public class Option implements Comparable<Option> {

public static final State INITIAL_STATE = new State(0.0, Double.MAX_VALUE, 0.0, null, 0.0);

public State state = INITIAL_STATE;
private State state = INITIAL_STATE;

public Activation act;
public SearchNode searchNode;

public Option parent;
public List<Option> children = new ArrayList<>();

public boolean fixed = false;
private Option parent;
private List<Option> children = new ArrayList<>();

public Decision decision;

public double weight;
private double weight;
public double remainingWeight;
public int cacheFactor = 1;
public double p;
Expand Down Expand Up @@ -81,7 +79,6 @@ public Option(Option parent, Activation act, SearchNode sn) {


public boolean setState(State s) {
assert !fixed;
if(state.equalsWithWeights(s)) {
return false;
}
Expand Down Expand Up @@ -114,7 +111,6 @@ public boolean isQueued() {

public void restoreState(Activation.Mode m) {
act.currentOption = (m == Activation.Mode.OLD ? parent : this);
assert act.currentOption.fixed;
}


Expand Down
16 changes: 12 additions & 4 deletions src/site/resources.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ <h2>Related Resources</h2>
<p>
<a href="https://medium.com/p/on-integrating-symbolic-inference-into-deep-neural-networks-22ed13ebbba9?fbclid=IwAR0Akwh1d8LCnlIQjvalGrmhcsSjzGl825dm3GhGPJ7PTY3cM9rHDkVtla0">On integrating symbolic inference into deep neural networks</a><br/>

Workshop: <a href="http://aika.network/Aika-Workshop.pdf">Einführung in den Aika-Algorithmus</a><br/>

<a href="https://data-science-blog.com/blog/2017/10/25/aika-ein-semantisches-neuronales-netzwerk/">A data science blog article about the Aika algorithm written in German.</a><br/>

<a href="https://jaxenter.de/texte-verstehen-mit-machine-learning-58487">A JAXenter article about the Aika algorithm.</a><br/>
Expand All @@ -69,16 +67,26 @@ <h2>Related Resources</h2>

<h2>Download</h2>
<p>
<a href="http://aika.network/download/aika-1.2.0.jar">Version 1.2.0</a> <br/>
<a href="http://aika.network/download/aika-1.3.0.jar">Version 1.3.0</a> <br/>
</p>

<h2>API Documentation</h2>

<p>
<a href="http://aika.network/apidocs/index.html">JavaDoc v1.2.0</a>
<a href="http://aika.network/apidocs/index.html">JavaDoc v1.3.0</a>
</p>

<h2>Release Notes</h2>
<h3>Aika Version 1.3.0 (2019-07-31)</h3>
<ul>
<li>
Major simplification of the interpretation search.
</li>
<li>
Code reorganization.
</li>
</ul>

<h3>Aika Version 1.2.0 (2019-06-07)</h3>
<ul>
<li>
Expand Down
117 changes: 51 additions & 66 deletions src/site/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h3>Maven POM</h3>
&lt;dependency&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;groupId&gt;org.aika-software&lt;&#47;groupId&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;artifactId&gt;aika&lt;&#47;artifactId&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;version&gt;1.1.0&lt;&#47;version&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;version&gt;1.3.0&lt;&#47;version&gt;<br/>
&lt;&#47;dependency&gt;<br/>
</b>
</p>
Expand All @@ -80,7 +80,7 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
HashMap&lt;String, Neuron&gt; inputNeurons = new HashMap<>();

for(String word: new String[] {"jackson", "cook"}) {
Neuron in = m.createNeuron("W-" + word);
Neuron in = m.createNeuron("W-" + word, INPUT);

inputNeurons.put(word, in);
}
Expand All @@ -93,9 +93,9 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
<div class="prettyprint-code">
<pre class="prettyprint">
<code class="language-java">
Neuron forenameCategory = m.createNeuron("C-forename");
Neuron surnameCategory = m.createNeuron("C-surname");
Neuron inhibitingN = m.createNeuron("INHIB");
Neuron forenameCategory = m.createNeuron("C-forename", INHIBITORY, LIMITED_RECTIFIED_LINEAR_UNIT);
Neuron surnameCategory = m.createNeuron("C-surname", INHIBITORY, LIMITED_RECTIFIED_LINEAR_UNIT);
Neuron inhibitingN = m.createNeuron("INHIB", INHIBITORY, LIMITED_RECTIFIED_LINEAR_UNIT);
</code>
</pre>
</div>
Expand All @@ -114,10 +114,8 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
<pre class="prettyprint">
<code class="language-java">
Neuron cookSurnameEntity = Neuron.init(
m.createNeuron("E-cook (surname)"),
m.createNeuron("E-cook (surname)", EXCITATORY, RECTIFIED_HYPERBOLIC_TANGENT),
6.0, // adjusts the bias
RECTIFIED_HYPERBOLIC_TANGENT,
EXCITATORY,
new Synapse.Builder() // Requires the word to be recognized
.setSynapseId(0)
.setNeuron(inputNeurons.get("cook"))
Expand Down Expand Up @@ -165,8 +163,6 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
Neuron.init(
forenameCategory,
0.0,
RECTIFIED_LINEAR_UNIT,
EXCITATORY,
new Synapse.Builder() // In this example there is only one forename considered.
.setSynapseId(0)
.setNeuron(jacksonForenameEntity)
Expand All @@ -180,8 +176,6 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
Neuron.init(
surnameCategory,
0.0,
RECTIFIED_LINEAR_UNIT,
EXCITATORY,
new Synapse.Builder()
.setSynapseId(0)
.setNeuron(cookSurnameEntity)
Expand All @@ -204,8 +198,6 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
Neuron.init(
inhibitingN,
0.0,
RECTIFIED_LINEAR_UNIT,
INHIBITORY,
new Synapse.Builder().setNeuron(cookProfessionEntity)
.setSynapseId(0)
.setWeight(1.0)
Expand Down Expand Up @@ -279,23 +271,27 @@ <h3>Named Entity Recognition / Entity Resolution example</h3>
<pre class="prettyprint">
<code class="language-java">

Activation ID - Final Decision - Slots | Identity - Neuron Label - Logic Layer - Upper Bound -
Activation ID - Neuron Type - Final Decision - Slots (Ranges) | Identity - Neuron Label - Logic Layer - Upper Bound -
Value | Sum | Weight - Input Value | Target Value

...
3 - SELECTED - (0:4, 1:12) () - C-forename - OR[] - V:1.0 Net:1.0 W:0.0
4 - SELECTED - (0:4, 1:12) () - INHIB - OR[] - V:1.0 Net:1.0 W:0.0
1 - SELECTED - (0:4, 1:12) () - W-jackson - OR[] - V:1.0 Net:0.0 W:0.0 - IV:1.0
2 - SELECTED - (0:4, 1:12) () - E-jackson (forename) - V:1.0 Net:6.0 W:6.0
5 - EXCLUDED - (0:4, 1:12) () - E-jackson (city) -
8 - SELECTED - (0:12, 1:17) () - C-surname - OR[] - V:1.0 Net:1.0 W:0.0
9 - SELECTED - (0:12, 1:17) () - INHIB - OR[] - V:1.0 Net:1.0 W:0.0
6 - SELECTED - (0:12, 1:17) () - W-cook - OR[] - V:1.0 Net:0.0 W:0.0 - IV:1.0
7 - SELECTED - (0:12, 1:17) () - E-cook (surname) - V:1.0 Net:8.0 W:8.0
10 - EXCLUDED - (0:12, 1:17) () - E-cook (profession) -
...

Final SearchNode:8 WeightSum:13.999
0 INPUT - - (0:0, 1:4) "mr. " () - W-mr. - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
4 INHIBITORY - - (0:4, 1:12) "jackson " () - C-forename - V:1.0 UB:1.0 Net:1.0 W:0.0
5 INHIBITORY - - (0:4, 1:12) "jackson " () - INHIB - V:1.0 UB:1.0 Net:1.0 W:0.0
1 INPUT - - (0:4, 1:12) "jackson " () - W-jackson - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
2 EXCITATORY - SELECTED - (0:4, 1:12) "jackson " () - E-jackson (forename) - V:1.0 UB:1.0 Net:6.0 W:6.0
3 EXCITATORY - EXCLUDED - (0:4, 1:12) "jackson " () - E-jackson (city) - V:0.0 UB:0.0 Net:-95.0 W:0.0
9 INHIBITORY - - (0:12, 1:17) "cook " () - C-surname - V:1.0 UB:1.0 Net:1.0 W:0.0
10 INHIBITORY - - (0:12, 1:17) "cook " () - INHIB - V:1.0 UB:1.0 Net:1.0 W:0.0
6 INPUT - - (0:12, 1:17) "cook " () - W-cook - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
7 EXCITATORY - SELECTED - (0:12, 1:17) "cook " () - E-cook (surname) - V:1.0 UB:1.0 Net:6.0 W:6.0
8 EXCITATORY - EXCLUDED - (0:12, 1:17) "cook " () - E-cook (profession) - V:0.0 UB:0.0 Net:-95.0 W:0.0
11 INPUT - - (0:17, 1:21) "was " () - W-was - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
12 INPUT - - (0:21, 1:26) "born " () - W-born - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
13 INPUT - - (0:26, 1:29) "in " () - W-in - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
14 INPUT - - (0:29, 1:33) "new " () - W-new - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
15 INPUT - - (0:33, 1:38) "york " () - W-york - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0

Final SearchNode:6 WeightSum:12.0
</code>
</pre>
</div>
Expand All @@ -316,19 +312,17 @@ <h3>Mutual exclusion example</h3>
Model m = new Model();

// Create the input neurons for the network.
Neuron inA = m.createNeuron("IN-A");
Neuron inB = m.createNeuron("IN-B");
Neuron inC = m.createNeuron("IN-C");
Neuron inA = m.createNeuron("IN-A", INPUT);
Neuron inB = m.createNeuron("IN-B", INPUT);
Neuron inC = m.createNeuron("IN-C", INPUT);

// Instantiate the inhibitory neuron. Its inputs will be added later on.
Neuron inhibN = m.createNeuron("INHIB");

// Create three neurons that might be suppressed by the inhibitory neuron.
Neuron pA = Neuron.init(
m.createNeuron("A"),
m.createNeuron("A", EXCITATORY),
3.0,
RECTIFIED_HYPERBOLIC_TANGENT,
EXCITATORY,
new Synapse.Builder()
.setSynapseId(0)
.setNeuron(inA)
Expand All @@ -352,10 +346,8 @@ <h3>Mutual exclusion example</h3>
);

Neuron pB = Neuron.init(
m.createNeuron("B"),
m.createNeuron("B", EXCITATORY),
5.0,
RECTIFIED_HYPERBOLIC_TANGENT,
EXCITATORY,
new Synapse.Builder()
.setSynapseId(0)
.setNeuron(inB)
Expand All @@ -379,10 +371,8 @@ <h3>Mutual exclusion example</h3>
);

Neuron pC = Neuron.init(
m.createNeuron("C"),
m.createNeuron("C", EXCITATORY),
2.0,
RECTIFIED_HYPERBOLIC_TANGENT,
EXCITATORY,
new Synapse.Builder()
.setSynapseId(0)
.setNeuron(inC)
Expand All @@ -409,8 +399,6 @@ <h3>Mutual exclusion example</h3>
Neuron.init(
inhibN,
0.0,
RECTIFIED_LINEAR_UNIT,
INHIBITORY,
new Synapse.Builder()
.setSynapseId(0)
.setNeuron(pA)
Expand Down Expand Up @@ -443,10 +431,9 @@ <h3>Mutual exclusion example</h3>
.setRelation(EQUALS)
);

Neuron outN = Neuron.init(m.createNeuron("OUT"),
Neuron outN = Neuron.init(
m.createNeuron("OUT", EXCITATORY),
0.0,
RECTIFIED_HYPERBOLIC_TANGENT,
EXCITATORY,
new Synapse.Builder()
.setSynapseId(0)
.setNeuron(pB)
Expand Down Expand Up @@ -486,17 +473,17 @@ <h3>Mutual exclusion example</h3>

<pre class="prettyprint">
<code class="language-java">
Activation ID - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
Activation ID - Neuron Type - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
Value | Net | Weight - Input Value | Target Value

0 - SELECTED - (0:0, 1:1) () - IN-A - V:1.0 Net:0.0 W:0.0 - IV:1.0
3 - SELECTED - (0:0, 1:1) () - IN-B - V:1.0 Net:0.0 W:0.0 - IV:1.0
6 - SELECTED - (0:0, 1:1) () - IN-C - V:1.0 Net:0.0 W:0.0 - IV:1.0
2 - SELECTED - (0:0, 1:1) () - INHIB - V:1.0 Net:1.0 W:0.0
1 - EXCLUDED - (0:0, 1:1) () - A -
4 - SELECTED - (0:0, 1:1) () - B - V:1.0 Net:5.0 W:5.0
7 - EXCLUDED - (0:0, 1:1) () - C -
5 - SELECTED - (0:0, 1:1) () - OUT - V:0.762 Net:1.0 W:0.0
0 INPUT - - (0:0, 1:1) "f" () - IN-A - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
3 INPUT - - (0:0, 1:1) "f" () - IN-B - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
6 INPUT - - (0:0, 1:1) "f" () - IN-C - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
2 INHIBITORY - - (0:0, 1:1) "f" () - INHIB - V:1.0 UB:1.0 Net:1.0 W:0.0
1 EXCITATORY - EXCLUDED - (0:0, 1:1) "f" () - A - V:0.0 UB:0.0 Net:-97.0 W:0.0
4 EXCITATORY - SELECTED - (0:0, 1:1) "f" () - B - V:1.0 UB:1.0 Net:5.0 W:5.0
7 EXCITATORY - EXCLUDED - (0:0, 1:1) "f" () - C - V:0.0 UB:0.0 Net:-98.0 W:0.0
5 INHIBITORY - - (0:0, 1:1) "f" () - OUT - V:0.762 UB:0.762 Net:1.0 W:0.0

Final SearchNode:10 WeightSum:5.0
</code>
Expand All @@ -518,16 +505,14 @@ <h3>Pattern matching example</h3>

// Create an input neuron for every letter in this example.
for(char c: new char[] {'a', 'b', 'c', 'd', 'e', 'f'}) {
Neuron in = m.createNeuron(c + "");
Neuron in = m.createNeuron(c + "", INPUT);

inputNeurons.put(c, in);
}

Neuron pattern = Neuron.init(
m.createNeuron("BCDE"),
m.createNeuron("BCDE", EXCITATORY),
5.0,
RECTIFIED_HYPERBOLIC_TANGENT,
EXCITATORY,
new Synapse.Builder()
.setSynapseId(0)
.setNeuron(inputNeurons.get('b'))
Expand Down Expand Up @@ -605,15 +590,15 @@ <h3>Pattern matching example</h3>
<div class="prettyprint-code">
<pre class="prettyprint">
<code class="language-java">
Activation ID - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
Activation ID - Neuron Type - Final Decision - Slots | Identity - Neuron Label - Upper Bound -
Value | Net | Weight - Input Value | Target Value

0 - SELECTED - (0:0, 1:2) () - a - V:1.0 Net:0.0 W:0.0 - IV:1.0
1 - SELECTED - (0:2, 1:4) () - b - V:1.0 Net:0.0 W:0.0 - IV:1.0
5 - SELECTED - (0:2, 1:10) () - BCDE - V:1.0 Net:5.0 W:0.0
2 - SELECTED - (0:4, 1:6) () - c - V:1.0 Net:0.0 W:0.0 - IV:1.0
3 - SELECTED - (0:6, 1:8) () - d - V:1.0 Net:0.0 W:0.0 - IV:1.0
4 - SELECTED - (0:8, 1:10) () - e - V:1.0 Net:0.0 W:0.0 - IV:1.0
0 INPUT - - (0:0, 1:2) "a " () - a - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
1 INPUT - - (0:2, 1:4) "b " () - b - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
5 EXCITATORY - SELECTED - (0:2, 1:10) "b c d e " () - BCDE - V:1.0 UB:1.0 Net:5.0 W:0.0
2 INPUT - - (0:4, 1:6) "c " () - c - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
3 INPUT - - (0:6, 1:8) "d " () - d - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0
4 INPUT - - (0:8, 1:10) "e " () - e - V:1.0 UB:1.0 Net:0.0 W:0.0 - IV:1.0

Final SearchNode:1 WeightSum:0.0
</code>
Expand Down

0 comments on commit afb5618

Please sign in to comment.