File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
core/src/main/java/network/aika/elements/activations
experiments/src/main/java/experiment/logger Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 2828import network .aika .elements .links .CategoryLink ;
2929import network .aika .elements .links .Link ;
3030import network .aika .ActivationFunction ;
31+ import network .aika .elements .neurons .CategoryNeuron ;
3132import network .aika .elements .neurons .Neuron ;
3233import network .aika .elements .neurons .NeuronProvider ;
3334import network .aika .elements .synapses .*;
@@ -492,6 +493,16 @@ public Stream<CategoryActivation> getCategoryActivations() {
492493 .filter (Objects ::nonNull );
493494 }
494495
496+ public Neuron getTemplateNeuron () {
497+ return getCategoryActivations ()
498+ .map (Activation ::getNeuron )
499+ .map (CategoryNeuron ::getOutgoingCategoryInputSynapse )
500+ .map (CategoryInputSynapse ::getOutput )
501+ .filter (Objects ::nonNull )
502+ .findFirst ()
503+ .orElse (null );
504+ }
505+
495506 public Stream <Activation > getTemplateInstances () {
496507 CategoryInputLink cil = getActiveCategoryInputLink ();
497508 if (cil == null || cil .getInput () == null )
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ public void close() {
130130
131131 public void log (PatternActivation pAct ) {
132132 PatternNeuron pn = pAct .getNeuron ();
133- Document doc = ( Document ) pAct .getDocument ();
133+ Document doc = pAct .getDocument ();
134134 try {
135135 List entry = new ArrayList ();
136136
Original file line number Diff line number Diff line change 7878
7979
8080 <properties >
81- <revision >2.0.9-rc30 </revision >
81+ <revision >2.0.9-rc31 </revision >
8282
8383 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
8484
You can’t perform that action at this time.
0 commit comments