Commit f1df76ef authored by Christian Fuß's avatar Christian Fuß
Browse files

changed some unroll tests

parent 31aa225b
Pipeline #179463 passed with stages
in 22 minutes and 47 seconds
......@@ -51,6 +51,19 @@ public class CheckLayerVariableDeclarationIsUsed extends CNNArchSymbolCoCo {
}
}
for (UnrollSymbol unroll : layerVariableDeclaration.getLayer().getArchitecture().getUnrolls()) {
for (ArchitectureElementSymbol element : unroll.getBodiesForAllTimesteps().get(0).getElements()) {
if (element instanceof VariableSymbol && ((VariableSymbol) element).getMember() == VariableSymbol.Member.NONE) {
isUsed = true;
break;
}
}
if (isUsed) {
break;
}
}
if (!isUsed) {
Log.error("0" + ErrorCodes.UNUSED_LAYER + " Unused layer. " +
"Declared layer variables need to be used as layer at least once.",
......
......@@ -52,7 +52,7 @@ public class BeamSearchStart extends PredefinedUnrollDeclaration {
new ParameterSymbol.Builder()
.name(AllPredefinedLayers.BEAMSEARCH_T_NAME)
.constraints(Constraints.INTEGER, Constraints.NON_NEGATIVE)
.defaultValue(0)
.defaultValue(1)
.build(),
new ParameterSymbol.Builder()
.name(AllPredefinedLayers.BEAMSEARCH_WIDTH_NAME)
......
......@@ -44,7 +44,6 @@ public class AllCoCoTest extends AbstractCoCoTest {
@Test
public void testValidCoCos(){
checkValid("valid_tests", "RNNencdec");
checkValid("architectures", "ResNeXt50");
checkValid("architectures", "ResNet152");
checkValid("architectures", "Alexnet");
......@@ -52,7 +51,6 @@ public class AllCoCoTest extends AbstractCoCoTest {
checkValid("architectures", "SequentialAlexnet");
checkValid("architectures", "ThreeInputCNN_M14");
checkValid("architectures", "VGG16");
checkValid("architectures", "RNNtest");
checkValid("valid_tests", "ArgumentSequenceTest");
checkValid("valid_tests", "Fixed_Alexnet");
......@@ -68,6 +66,8 @@ public class AllCoCoTest extends AbstractCoCoTest {
checkValid("valid_tests", "Alexnet_alt2");
checkValid("valid_tests", "MultipleOutputs");
checkValid("valid_tests", "MultipleStreams");
checkValid("valid_tests", "RNNencdec");
checkValid("valid_tests", "RNNtest");
}
......
architecture RNNtest(max_length=50, vocabulary_size=30001, hidden_size=500) {
def input Q(-oo:oo)^{10} source[2]
def output Q(-oo:oo)^{10} target[2]
layer RNN(units=10) encoder;
layer RNN(units=10) decoder;
source[0] ->
encoder ->
target[0];
encoder.state ->
decoder.state;
source[1] ->
decoder ->
target[1];
}
architecture RNNencdec(max_length=50, vocabulary_size=30000, hidden_size=1000){
def input Q(0:1)^{vocabulary_size} source
def output Q(0:1)^{vocabulary_size} target[5]
source -> Softmax() -> target[0];
timed <t=0> BeamSearchStart(max_length=4){
source ->
FullyConnected(units=30000) ->
Softmax() ->
target[t+1]
};
}
\ No newline at end of file
def input N(0:29999)^{50} source
def output Q(0:29999)^{1} target[50]
layer LSTM(units=hidden_size) encoder;
source ->
Embedding(output_dim=hidden_size) ->
encoder;
layer LSTM(units=hidden_size) decoder;
1 -> target[0];
encoder.state -> decoder.state;
timed<t=1> BeamSearchStart(max_length=50) {
target[t-1] ->
Embedding(output_dim=hidden_size) ->
decoder ->
FullyConnected(units=vocabulary_size) ->
Softmax() ->
target[t]
};
}
\ No newline at end of file
architecture RNNtest(max_length=50, vocabulary_size=30000, hidden_size=1000){
def input Q(0:1)^{vocabulary_size} source
def output Q(0:1)^{vocabulary_size} target[5]
source -> Softmax() -> target[0];
timed <t=1> BeamSearchStart(max_length=5){
(target[0] | target[t-1]) ->
Concatenate() ->
FullyConnected(units=30000) ->
Softmax() ->
target[t]
};
}
\ No newline at end of file
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