Skip to content

Commit a625c52

Browse files
author
Lukas Molzberger
committed
Removed DistanceFunction
1 parent cf61915 commit a625c52

File tree

3 files changed

+0
-63
lines changed

3 files changed

+0
-63
lines changed

src/main/java/network/aika/DistanceFunction.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/main/java/network/aika/neuron/Synapse.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ public class Synapse implements Writable {
8989

9090
private Map<Integer, Relation> relations = new TreeMap<>();
9191

92-
private DistanceFunction distanceFunction = null;
93-
9492
private boolean inactive;
9593
private boolean inactiveNew;
9694

@@ -148,15 +146,6 @@ public void setRelations(Map<Integer, Relation> relations) {
148146
this.relations = relations;
149147
}
150148

151-
public DistanceFunction getDistanceFunction() {
152-
return distanceFunction;
153-
}
154-
155-
public void setDistanceFunction(DistanceFunction distanceFunction) {
156-
this.distanceFunction = distanceFunction;
157-
}
158-
159-
160149
public boolean isInactive() {
161150
return inactive;
162151
}
@@ -387,11 +376,6 @@ public void write(DataOutput out) throws IOException {
387376
me.getValue().write(out);
388377
}
389378

390-
out.writeBoolean(distanceFunction != null);
391-
if(distanceFunction != null) {
392-
out.writeUTF(distanceFunction.name());
393-
}
394-
395379
out.writeDouble(weight);
396380
out.writeDouble(limit);
397381

@@ -415,10 +399,6 @@ public void readFields(DataInput in, Model m) throws IOException {
415399
relations.put(relId, Relation.read(in, m));
416400
}
417401

418-
if(in.readBoolean()) {
419-
distanceFunction = DistanceFunction.valueOf(in.readUTF());
420-
}
421-
422402
weight = in.readDouble();
423403
limit = in.readDouble();
424404

@@ -482,7 +462,6 @@ public static class Builder implements Neuron.Builder {
482462
private Neuron neuron;
483463
double weight;
484464
double limit = 1.0;
485-
private DistanceFunction distanceFunction;
486465
private boolean identity;
487466
private Integer synapseId;
488467

@@ -546,12 +525,6 @@ public Builder setLimit(double limit) {
546525
}
547526

548527

549-
public Builder setDistanceFunction(DistanceFunction distFunc) {
550-
this.distanceFunction = distFunc;
551-
return this;
552-
}
553-
554-
555528
public Builder setIdentity(boolean identity) {
556529
this.identity = identity;
557530
return this;
@@ -576,7 +549,6 @@ public Synapse getSynapse(Neuron outputNeuron) {
576549

577550
s.isRecurrent = recurrent;
578551
s.identity = identity;
579-
s.distanceFunction = distanceFunction;
580552

581553
return s;
582554
}

src/main/java/network/aika/neuron/activation/Activation.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,6 @@ public State computeValueAndWeight(int round) throws RecursiveDepthExceededExcep
390390
if (iAct == this) continue;
391391

392392
double x = Math.min(s.getLimit(), is.s.value) * s.getWeight();
393-
if(s.getDistanceFunction() != null) {
394-
x *= s.getDistanceFunction().f(iAct, this);
395-
}
396393
net += x;
397394
if(!s.isNegative(CURRENT)) {
398395
posNet += x;
@@ -464,9 +461,6 @@ public boolean isActiveable() {
464461
}
465462

466463
double x = iv * s.getWeight();
467-
if(s.getDistanceFunction() != null) {
468-
x *= s.getDistanceFunction().f(iAct, this);
469-
}
470464
net += x;
471465
}
472466

@@ -518,9 +512,6 @@ public void computeBounds() throws RecursiveDepthExceededException {
518512
if (iAct == this) continue;
519513

520514
double x = s.getWeight();
521-
if(s.getDistanceFunction() != null) {
522-
x *= s.getDistanceFunction().f(iAct, this);
523-
}
524515

525516
if (s.isNegative(CURRENT)) {
526517
if (!s.isRecurrent() && !iAct.checkSelfReferencing(false, 0, v)) {

0 commit comments

Comments
 (0)