Commit 13a3d4ad authored by Svetlana Pavlitskaya's avatar Svetlana Pavlitskaya

Changes in folder structure

parent 5a8867af
output/
generated/
target/
output/
.idea/
.git
*.iml
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: de.monticore.lang:NumberUnit:0.0.10-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180313.012035-1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180410.013402-1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180313.012035-1-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180410.013402-1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180313.012035-1-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180410.013402-1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: de.monticore.lang.monticar:common-monticar:0.0.10-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/common-monticar/0.0.10-SNAPSHOT/common-monticar-0.0.10-20180214.010746-1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/common-monticar/0.0.10-SNAPSHOT/common-monticar-0.0.10-20180214.010746-1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/common-monticar/0.0.10-SNAPSHOT/common-monticar-0.0.10-20180214.010746-1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: de.monticore.lang.monticar:embedded-montiarc:0.0.10-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc/0.0.10-SNAPSHOT/embedded-montiarc-0.0.10-20180122.004719-1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc/0.0.10-SNAPSHOT/embedded-montiarc-0.0.10-20180122.004719-1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc/0.0.10-SNAPSHOT/embedded-montiarc-0.0.10-20180122.004719-1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: de.monticore.lang.monticar:embedded-montiarc-math:0.0.10-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc-math/0.0.10-SNAPSHOT/embedded-montiarc-math-0.0.10-20180122.005240-1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc-math/0.0.10-SNAPSHOT/embedded-montiarc-math-0.0.10-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc-math/0.0.10-SNAPSHOT/embedded-montiarc-math-0.0.10-20180122.005240-1-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc-math/0.0.10-SNAPSHOT/embedded-montiarc-math-0.0.10-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc-math/0.0.10-SNAPSHOT/embedded-montiarc-math-0.0.10-20180122.005240-1-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/monticar/embedded-montiarc-math/0.0.10-SNAPSHOT/embedded-montiarc-math-0.0.10-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
......@@ -7,7 +10,7 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
......@@ -49,7 +49,7 @@
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.3.7" level="project" />
<orderEntry type="library" name="Maven: jline:jline:2.12" level="project" />
<orderEntry type="library" name="Maven: de.monticore.lang:NumberUnit:0.0.10-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: de.monticore.lang.monticar:common-monticar:0.0.10-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: de.monticore.lang.monticar:common-monticar:0.0.11-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.2" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.2" level="project" />
<orderEntry type="library" name="Maven: org.jscience:jscience:4.3.1" level="project" />
......@@ -81,5 +81,8 @@
<orderEntry type="library" name="Maven: com.esotericsoftware.yamlbeans:yamlbeans:1.12" level="project" />
<orderEntry type="library" name="Maven: de.moticore.lang.monticar:embedded-montiarc-math-middleware-generator:0.0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: org.jgrapht:jgrapht-core:1.1.0" level="project" />
<orderEntry type="library" name="Maven: de.monticore.lang.monticar:embedded-montiarc-deeplearning:0.2.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: de.monticore.lang.monticar:cnn-arch:0.2.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: de.monticore.lang.monticar:cnn-train:0.2.0-SNAPSHOT" level="project" />
</component>
</module>
\ No newline at end of file
%!/bin/bash
echo "Building DriverController"
cd Drivercontroller
mkdir -p build
cd build
cmake ..
make -j
cd ../../
echo "Building SafetyController"
cd Safetycontroller
mkdir -p build
cd build
cmake ..
make -j
cd ../../
echo "Building FeatureExtraction"
cd Featureextraction
mkdir -p build
cd build
cmake ..
make -j
cd ../../
echo "Building ImagePreprocessing"
cd Imagepreprocessing
mkdir -p build
cd build
cmake ..
make -j
cd ../../
echo
echo "Well done!"
echo "Run ./run_all.sh to run all."
%!/bin/bash
xterm -T DriverController -e Drivercontroller/build/coordinator/Coordinator_dp_drivercontroller &
xterm -T SafetyController -e Safetycontroller/build/coordinator/Coordinator_dp_safetycontroller &
xterm -T FeatureExtraction -e Featureextraction/build/coordinator/Coordinator_dp_featureextraction &
xterm -T ImagePreprocessing -e Imagepreprocessing/build/coordinator/Coordinator_dp_imagepreprocessing &
......@@ -41,6 +41,11 @@
<artifactId>embedded-montiarc-math-middleware-generator</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-deeplearning</artifactId>
<version>0.2.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -2,6 +2,7 @@ package de.monticore.lang.monticar.torcs_dl;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.RosToEmamTagSchema;
import de.monticore.lang.monticar.emadl.generator.Generator;
import de.monticore.lang.monticar.generator.middleware.MiddlewareGenerator;
import de.monticore.lang.monticar.generator.middleware.impls.CPPGenImpl;
import de.monticore.lang.monticar.generator.middleware.impls.RosCppGenImpl;
......@@ -15,27 +16,25 @@ import de.monticore.lang.monticar.generator.order.nfp.TagThresholdTagSchema.TagT
import de.monticore.lang.monticar.generator.roscpp.helper.TagHelper;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.Scope;
import freemarker.template.TemplateException;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.LinkedList;
import static de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab.createSymTab;
public class Experiments {
public static final String TARGET_PATH_GENERATED = "./target/generated-sources-torcs-dl/";
public static final String MODELS_PATH = "src/main/models/";
public static void main(String[] args) {
System.out.println("Experiments!");
Scope scope = createSymTab("resources");
TaggingResolver taggingResolver = new TaggingResolver(scope, Arrays.asList("resources"));
TagMinMaxTagSchema.registerTagTypes(taggingResolver);
TagTableTagSchema.registerTagTypes(taggingResolver);
TagBreakpointsTagSchema.registerTagTypes(taggingResolver);
TagExecutionOrderTagSchema.registerTagTypes(taggingResolver);
TagInitTagSchema.registerTagTypes(taggingResolver);
TagThresholdTagSchema.registerTagTypes(taggingResolver);
TagDelayTagSchema.registerTagTypes(taggingResolver);
System.out.println("Starting code generation...");
TaggingResolver taggingResolver = createSymTabAndTaggingResolver(MODELS_PATH);
RosToEmamTagSchema.registerTagTypes(taggingResolver);
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
......@@ -57,7 +56,7 @@ public class Experiments {
TagHelper.resolveTags(taggingResolver, componentInstanceSymbol);
middlewareGenerator.setGenerationTargetPath("generated/"+inpu);
middlewareGenerator.setGenerationTargetPath(TARGET_PATH_GENERATED +inpu);
middlewareGenerator.generate(componentInstanceSymbol, taggingResolver);
}
......@@ -65,4 +64,24 @@ public class Experiments {
e.printStackTrace();
}
}
public static TaggingResolver createSymTabAndTaggingResolver(String... modelPath) {
Scope scope = createSymTab(modelPath);
TaggingResolver tagging = new TaggingResolver(scope, Arrays.asList(modelPath));
TagMinMaxTagSchema.registerTagTypes(tagging);
TagTableTagSchema.registerTagTypes(tagging);
TagBreakpointsTagSchema.registerTagTypes(tagging);
TagExecutionOrderTagSchema.registerTagTypes(tagging);
TagInitTagSchema.registerTagTypes(tagging);
TagThresholdTagSchema.registerTagTypes(tagging);
TagDelayTagSchema.registerTagTypes(tagging);
return tagging;
}
private void generateEMADL(String qualifiedName) throws IOException, TemplateException {
Path modelPath = Paths.get(MODELS_PATH);
Generator gen = new Generator();
gen.generate(modelPath, qualifiedName);
}
}
component Alexnet{
ports in Z(0:255)^{3, 224, 224} image,
out Q(0:1)^{10,1,1} 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=10) ->
Softmax() ->
predictions
}
}
\ 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