Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
languages
CNNArchLang
Commits
f1df76ef
Commit
f1df76ef
authored
Sep 03, 2019
by
Christian Fuß
Browse files
changed some unroll tests
parent
31aa225b
Pipeline
#179463
passed with stages
in 22 minutes and 47 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/_cocos/CheckLayerVariableDeclarationIsUsed.java
View file @
f1df76ef
...
...
@@ -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."
,
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/BeamSearchStart.java
View file @
f1df76ef
...
...
@@ -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
)
...
...
src/test/java/de/monticore/lang/monticar/cnnarch/cocos/AllCoCoTest.java
View file @
f1df76ef
...
...
@@ -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"
);
}
...
...
src/test/resources/architectures/RNNtest.cnna
deleted
100644 → 0
View file @
31aa225b
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];
}
src/test/resources/valid_tests/RNNencdec.cnna
View file @
f1df76ef
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
src/test/resources/valid_tests/RNNtest.cnna
0 → 100644
View file @
f1df76ef
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment