Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
monticore
EmbeddedMontiArc
generators
EMADL2CPP
Commits
fa3c7beb
Commit
fa3c7beb
authored
Jul 03, 2019
by
cesomark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added invalid type test
parent
41bd1e53
Pipeline
#156042
failed with stages
in 10 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
0 deletions
+71
-0
src/test/java/de/monticore/lang/monticar/emadl/GenerationTest.java
...java/de/monticore/lang/monticar/emadl/GenerationTest.java
+14
-0
src/test/resources/models/tagging/AlexNet.tag
src/test/resources/models/tagging/AlexNet.tag
+1
-0
src/test/resources/models/tagging/AlexnetInvalidType.cnnt
src/test/resources/models/tagging/AlexnetInvalidType.cnnt
+7
-0
src/test/resources/models/tagging/AlexnetInvalidType.emadl
src/test/resources/models/tagging/AlexnetInvalidType.emadl
+49
-0
No files found.
src/test/java/de/monticore/lang/monticar/emadl/GenerationTest.java
View file @
fa3c7beb
...
...
@@ -208,4 +208,18 @@ public class GenerationTest extends AbstractSymtabTest {
assertTrue
(
Log
.
getErrorCount
()
==
0
);
}
@Test
public
void
testInvalidTypeCocos
()
{
Log
.
getFindings
().
clear
();
String
[]
args
=
{
"-m"
,
"src/test/resources/models/"
,
"-r"
,
"tagging.AlexnetInvalidType"
,
"-b"
,
"MXNET"
,
"-f"
,
"n"
,
"-c"
,
"n"
};
EMADLGeneratorCli
.
main
(
args
);
assertEquals
(
Log
.
getFindings
().
size
(),
2
);
assertEquals
(
Log
.
getFindings
().
get
(
0
).
toString
(),
"DatapathType is incorrect, must be of Type: HDF5 or LMDB"
);
assertEquals
(
Log
.
getFindings
().
get
(
1
).
toString
(),
"Tagfile was found, ignoring data_paths.txt: src/test/resources/models"
);
assertTrue
(
Log
.
getErrorCount
()
==
0
);
}
}
src/test/resources/models/tagging/AlexNet.tag
View file @
fa3c7beb
...
...
@@ -4,6 +4,7 @@ conforms to dltag.DataPathTagSchema;
tags
Alexnet
{
tag
Alexnet
with
DataPath
=
{
path
=
src
/
test
/
resources
/
models
,
type
=
LMDB
};
tag
AlexnetInvalid
with
DataPath
=
{
path
=
test
/
resources
/
models
,
type
=
random
};
tag
AlexnetInvalidType
with
DataPath
=
{
path
=
src
/
test
/
resources
/
models
,
type
=
LMBD
};
tag
Parent
.
a1
with
DataPath
=
{
path
=
instanceA1
,
type
=
random
};
}
...
...
src/test/resources/models/tagging/AlexnetInvalidType.cnnt
0 → 100644
View file @
fa3c7beb
configuration AlexnetInvalidType{
num_epoch : 100
batch_size : 500
optimizer : adam{
learning_rate : 0.001
}
}
src/test/resources/models/tagging/AlexnetInvalidType.emadl
0 → 100644
View file @
fa3c7beb
package
tagging
;
component
AlexnetInvalidType
{
ports
in
Z
(
0
:
255
)^{
3
,
224
,
224
}
image
,
out
Q
(
0
:
1
)^{
1000
}
predictions
;
implementation
CNN
{
def
split1
(
i
){
[
i
]
->
Convolution
(
kernel
=(
5
,
5
),
channels
=
128
)
->
Lrn
(
nsize
=
5
,
alpha
=
0.0001
,
beta
=
0.75
)
->
Pooling
(
pool_type
=
"max"
,
kernel
=(
3
,
3
),
stride
=(
2
,
2
),
padding
=
"no_loss"
)
->
Relu
()
}
def
split2
(
i
){
[
i
]
->
Convolution
(
kernel
=(
3
,
3
),
channels
=
192
)
->
Relu
()
->
Convolution
(
kernel
=(
3
,
3
),
channels
=
128
)
->
Pooling
(
pool_type
=
"max"
,
kernel
=(
3
,
3
),
stride
=(
2
,
2
),
padding
=
"no_loss"
)
->
Relu
()
}
def
fc
(){
FullyConnected
(
units
=
4096
)
->
Relu
()
->
Dropout
()
}
image
->
Convolution
(
kernel
=(
11
,
11
),
channels
=
96
,
stride
=(
4
,
4
),
padding
=
"no_loss"
)
->
Lrn
(
nsize
=
5
,
alpha
=
0.0001
,
beta
=
0.75
)
->
Pooling
(
pool_type
=
"max"
,
kernel
=(
3
,
3
),
stride
=(
2
,
2
),
padding
=
"no_loss"
)
->
Relu
()
->
Split
(
n
=
2
)
->
split1
(
i
=[
0
|
1
])
->
Concatenate
()
->
Convolution
(
kernel
=(
3
,
3
),
channels
=
384
)
->
Relu
()
->
Split
(
n
=
2
)
->
split2
(
i
=[
0
|
1
])
->
Concatenate
()
->
fc
(->=
2
)
->
FullyConnected
(
units
=
1000
)
->
Softmax
()
->
predictions
}
}
\ 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