Aufgrund einer Wartung wird GitLab am 17.08. zwischen 8:30 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 17.08. between 8:30 and 9:00 am.

Commit dbba18a6 authored by Christian Fuß's avatar Christian Fuß

Small fix to correctly use rnn states as inputs for other layers

parent 7c7ced1d
Pipeline #193138 failed with stages
in 17 seconds
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
package de.monticore.lang.monticar.cnnarch.generator; package de.monticore.lang.monticar.cnnarch.generator;
import de.monticore.lang.monticar.cnnarch._symboltable.*; import de.monticore.lang.monticar.cnnarch._symboltable.*;
import de.monticore.lang.monticar.cnnarch.predefined.AllPredefinedLayers;
import de.monticore.lang.monticar.cnnarch.predefined.Sigmoid; import de.monticore.lang.monticar.cnnarch.predefined.Sigmoid;
import de.monticore.lang.monticar.cnnarch.predefined.Softmax; import de.monticore.lang.monticar.cnnarch.predefined.Softmax;
...@@ -141,7 +142,13 @@ public abstract class CNNArchTemplateController { ...@@ -141,7 +142,13 @@ public abstract class CNNArchTemplateController {
for (ArchitectureElementSymbol input : layer.getPrevious()) { for (ArchitectureElementSymbol input : layer.getPrevious()) {
if (input.getOutputTypes().size() == 1) { if (input.getOutputTypes().size() == 1) {
inputNames.add(getName(input)); //If the input is an RNN state which is saved as list, take its first entry (unless a state is assigned to another state)
if(input instanceof VariableSymbol && ((VariableSymbol) input).getMember() == VariableSymbol.Member.STATE
&& !(getCurrentElement().getElement() instanceof VariableSymbol && ((VariableSymbol) getCurrentElement().getElement()).getMember() == VariableSymbol.Member.STATE)){
inputNames.add(getName(input) + "[" + 0 + "]");
}else{
inputNames.add(getName(input));
}
} else { } else {
for (int i = 0; i < input.getOutputTypes().size(); i++) { for (int i = 0; i < input.getOutputTypes().size(); i++) {
inputNames.add(getName(input) + "[" + i + "]"); inputNames.add(getName(input) + "[" + i + "]");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment