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
94359216
Commit
94359216
authored
Oct 27, 2020
by
Julian Johannes Steinsberger-Dührßen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for cnnarc2x changes
parent
84864d73
Pipeline
#348719
failed with stage
in 2 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
25 deletions
+24
-25
pom.xml
pom.xml
+4
-4
src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java
...nticore/lang/monticar/emadl/generator/EMADLGenerator.java
+20
-21
No files found.
pom.xml
View file @
94359216
...
...
@@ -17,13 +17,13 @@
<!-- .. SE-Libraries .................................................. -->
<emadl.version>
0.2.12-SNAPSHOT
</emadl.version>
<CNNTrain.version>
0.
3.12
-SNAPSHOT
</CNNTrain.version>
<cnnarch-generator.version>
0.
0.7
-SNAPSHOT
</cnnarch-generator.version>
<CNNTrain.version>
0.
4.0
-SNAPSHOT
</CNNTrain.version>
<cnnarch-generator.version>
0.
4.0
-SNAPSHOT
</cnnarch-generator.version>
<cnnarch-mxnet-generator.version>
0.2.17-SNAPSHOT
</cnnarch-mxnet-generator.version>
<cnnarch-caffe2-generator.version>
0.2.14-SNAPSHOT
</cnnarch-caffe2-generator.version>
<cnnarch-gluon-generator.version>
0.
2.12
-SNAPSHOT
</cnnarch-gluon-generator.version>
<cnnarch-gluon-generator.version>
0.
4.0
-SNAPSHOT
</cnnarch-gluon-generator.version>
<cnnarch-tensorflow-generator.version>
0.1.0-SNAPSHOT
</cnnarch-tensorflow-generator.version>
<Common-MontiCar.version>
0.
0
.1
9
-SNAPSHOT
</Common-MontiCar.version>
<Common-MontiCar.version>
0.
2
.1
2
-SNAPSHOT
</Common-MontiCar.version>
<embedded-montiarc-math-opt-generator>
0.1.6
</embedded-montiarc-math-opt-generator>
<!-- .. Libraries .................................................. -->
...
...
src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java
View file @
94359216
...
...
@@ -342,12 +342,9 @@ public class EMADLGenerator {
fileContents
.
addAll
(
generateCNNTrainer
(
allInstances
,
instanceName
));
fileContents
.
add
(
ArmadilloHelper
.
getArmadilloHelperFileContent
());
TypesGeneratorCPP
tg
=
new
TypesGeneratorCPP
();
fileContents
.
addAll
(
tg
.
generateTypes
(
TypeConverter
.
getTypeSymbols
()));
if
(
cnnArchGenerator
.
is
CMakeRequired
())
{
if
(
cnnArchGenerator
.
is
GenerateCMake
())
{
cnnArchGenerator
.
setGenerationTargetPath
(
getGenerationTargetPath
());
Map
<
String
,
String
>
cmakeContentsMap
=
cnnArchGenerator
.
generateCMakeContent
(
componentInstanceSymbol
.
getFullName
());
for
(
String
fileName
:
cmakeContentsMap
.
keySet
()){
fileContents
.
add
(
new
FileContent
(
cmakeContentsMap
.
get
(
fileName
),
fileName
));
}
fileContents
.
addAll
(
cnnArchGenerator
.
generateCMakeContent
(
componentInstanceSymbol
.
getFullName
()));
}
if
(
emamGen
.
shouldGenerateMainClass
())
{
...
...
@@ -503,28 +500,33 @@ public class EMADLGenerator {
}
public
void
generateCNN
(
List
<
FileContent
>
fileContents
,
TaggingResolver
taggingResolver
,
EMAComponentInstanceSymbol
instance
,
ArchitectureSymbol
architecture
){
Map
<
String
,
String
>
contentMap
=
cnnArchGenerator
.
generateStrings
(
architecture
);
//Map<String,String> contentMap = cnnArchGenerator.generateStrings(taggingResolver, architecture);
List
<
FileContent
>
contentList
=
cnnArchGenerator
.
generateStrings
(
taggingResolver
,
architecture
);
String
fullName
=
instance
.
getFullName
().
replaceAll
(
"\\."
,
"_"
);
//get the components execute method
String
executeKey
=
"execute_"
+
fullName
;
String
executeMethod
=
contentMap
.
get
(
executeKey
);
if
(
executeMethod
==
null
){
String
executeMethod
=
null
;
FileContent
executeContent
=
null
;
String
applyBeamSearchMethod
=
null
;
for
(
FileContent
content
:
contentList
){
if
(
content
.
getFileName
().
equals
(
"execute_"
+
fullName
)){
executeMethod
=
content
.
getFileContent
();
executeContent
=
content
;
}
else
if
(
content
.
getFileName
().
equals
(
"BeamSearch_"
+
fullName
)){
applyBeamSearchMethod
=
content
.
getFileContent
();
}
}
if
(
executeMethod
==
null
)
{
throw
new
IllegalStateException
(
"execute method of "
+
fullName
+
" not found"
);
}
else
{
contentList
.
remove
(
executeContent
);
}
contentMap
.
remove
(
executeKey
);
String
applyBeamSearchMethod
=
contentMap
.
get
(
"BeamSearch_"
+
fullName
);
String
component
=
emamGen
.
generateString
(
taggingResolver
,
instance
,
(
MathStatementsSymbol
)
null
);
FileContent
componentFileContent
=
new
FileContent
(
transformComponent
(
component
,
"CNNPredictor_"
+
fullName
,
applyBeamSearchMethod
,
executeMethod
,
architecture
),
instance
);
for
(
String
fileName
:
contentMap
.
keySet
()){
fileContents
.
add
(
new
FileContent
(
contentMap
.
get
(
fileName
),
fileName
));
}
fileContents
.
add
(
componentFileContent
);
fileContents
.
addAll
(
contentList
);
fileContents
.
add
(
new
FileContent
(
readResource
(
"CNNTranslator.h"
,
Charsets
.
UTF_8
),
"CNNTranslator.h"
));
}
...
...
@@ -735,10 +737,7 @@ public class EMADLGenerator {
}
cnnTrainGenerator
.
setInstanceName
(
componentInstance
.
getFullName
().
replaceAll
(
"\\."
,
"_"
));
Map
<
String
,
String
>
fileContentMap
=
cnnTrainGenerator
.
generateStrings
(
configuration
);
for
(
String
fileName
:
fileContentMap
.
keySet
()){
fileContents
.
add
(
new
FileContent
(
fileContentMap
.
get
(
fileName
),
fileName
));
}
fileContents
.
addAll
(
cnnTrainGenerator
.
generateStrings
(
configuration
));
}
}
return
fileContents
;
...
...
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