File tree 3 files changed +20
-1
lines changed
src/main/java/network/aika/neuron
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -896,6 +896,8 @@ public void updateSynapse(Synapse s) {
896
896
private void updateSynapse (Synapse .State state , double sign , Synapse s ) {
897
897
updateSum (s .isRecurrent (), s .isNegative (state ), sign * (s .getLimit (state ) * s .getWeight (state )));
898
898
899
+ posDirSumDelta += sign * s .computeMaxRelationWeights ();
900
+
899
901
if (s .getInput ().get ().isPassiveInputNeuron () && !s .isNegative (state )) {
900
902
posPassiveSumDelta += sign * (!s .isNegative (state ) ? (s .getLimit (state ) * s .getWeight (state )) : 0.0 );
901
903
}
Original file line number Diff line number Diff line change 19
19
20
20
import network .aika .*;
21
21
import network .aika .Document ;
22
+ import network .aika .neuron .activation .Activation ;
22
23
import network .aika .neuron .relation .Relation ;
23
24
import network .aika .Writable ;
24
25
@@ -301,6 +302,14 @@ public boolean isZero() {
301
302
return Math .abs (weight ) < TOLERANCE ;
302
303
}
303
304
305
+ public double computeRelationWeights (Activation .Link l ) {
306
+ return 0 ;
307
+ }
308
+
309
+ public double computeMaxRelationWeights () {
310
+ return 0 ;
311
+ }
312
+
304
313
305
314
public enum State {
306
315
NEXT ,
Original file line number Diff line number Diff line change @@ -391,6 +391,9 @@ public State computeValueAndWeight(int round) throws RecursiveDepthExceededExcep
391
391
392
392
double x = Math .min (s .getLimit (), is .s .value ) * s .getWeight ();
393
393
net += x ;
394
+
395
+ net += s .computeRelationWeights (is .l );
396
+
394
397
if (!s .isNegative (CURRENT )) {
395
398
posNet += x ;
396
399
}
@@ -441,7 +444,6 @@ public State computeValueAndWeight(int round) throws RecursiveDepthExceededExcep
441
444
442
445
public boolean isActiveable () {
443
446
INeuron n = getINeuron ();
444
- SynapseSummary ss = n .getSynapseSummary ();
445
447
446
448
double net = n .getTotalBias (CURRENT );
447
449
@@ -462,6 +464,8 @@ public boolean isActiveable() {
462
464
463
465
double x = iv * s .getWeight ();
464
466
net += x ;
467
+
468
+ net += s .computeRelationWeights (l );
465
469
}
466
470
467
471
for (Synapse s : n .getPassiveInputSynapses ()) {
@@ -522,6 +526,10 @@ public void computeBounds() throws RecursiveDepthExceededException {
522
526
} else {
523
527
ub += Math .min (s .getLimit (), iAct .upperBound ) * x ;
524
528
lb += Math .min (s .getLimit (), iAct .lowerBound ) * x ;
529
+
530
+ double rlw = s .computeRelationWeights (l );
531
+ ub += rlw ;
532
+ lb += rlw ;
525
533
}
526
534
}
527
535
You can’t perform that action at this time.
0 commit comments