Commit a3438ace authored by Evgeny Kusmenko's avatar Evgeny Kusmenko
Browse files

Merge branch 'feature/newTagSchema' into 'master'

Feature/new tag schema

See merge request !20
parents fe86b3ea a788dba9
Pipeline #318589 passed with stage
in 2 minutes and 52 seconds
......@@ -27,8 +27,8 @@ import java.util.regex.Pattern;
public class DataPathSymbolCreator implements TagSymbolCreator {
private final String regexExpression = "\\s*\\{\\s*path\\s*=\\s*(.*)\\s*,\\s*type\\s*=\\s*(.*)\\s*\\}\\s*";
private final Pattern pattern = Pattern.compile(regexExpression, Pattern.MULTILINE);
protected final String regexExpression = "\\s*\\{\\s*path\\s*=\\s*(.*)\\s*,\\s*type\\s*=\\s*(.*)\\s*\\}\\s*";
protected final Pattern pattern = Pattern.compile(regexExpression, Pattern.MULTILINE);
@Override
public void create(ASTTaggingUnit unit, TaggingResolver tagging) {
......@@ -56,7 +56,7 @@ public class DataPathSymbolCreator implements TagSymbolCreator {
}
}
private void addTag(ASTTag tag, TaggingResolver tagging, String root, SymbolKind kind) {
protected void addTag(ASTTag tag, TaggingResolver tagging, String root, SymbolKind kind) {
tag.getTagElementList().stream()
.filter(tagElement -> tagElement.getName().equals("DataPath"))
.forEachOrdered(tagElement -> {
......@@ -75,7 +75,7 @@ public class DataPathSymbolCreator implements TagSymbolCreator {
});
}
private Matcher matchRegexPattern(String regex) {
protected Matcher matchRegexPattern(String regex) {
Matcher matcher = pattern.matcher(regex);
if (matcher.matches()) {
return matcher;
......@@ -92,7 +92,7 @@ public class DataPathSymbolCreator implements TagSymbolCreator {
}
private String dotJoin(String root, String name) {
protected String dotJoin(String root, String name) {
if (StringUtils.isEmpty(root)) {
return name;
}
......
......@@ -2,5 +2,26 @@
package dltag;
tagschema DeepLearningFilePathSchema {
/*
tag schema definition for use in EmbeddedMontiArcDL
The CNNTrainModel field of training config data is optional.
When this field is not present, we'll try to load the CNNTrain model with the same name as the tagged MTDL/EMADL model
TODO add corresponding implementation for the rest two tag schemas in EMADL and apply them in EMADL2CPP
*/
tagtype DataPath for EMAComponentSymbol is { path = ${path:String}, type = ${type:String} };
tagtype TrainingConfigDataPath for EMAComponentSymbol is { CNNTrainModel = ${CNNTrainModel:String} };
tagtype PreTrainedModelWeightsDataPath for EMAComponentSymbol is { path = ${path:String}, fileName = ${type:String} };
/*
tag schema definition for use in MontiThingsDL
The CNNTrainModel field of training config data is optional.
When this field is not present, we'll try to load the CNNTrain model with the same name as the tagged MTDL/EMADL model
*/
tagtype DataPath for ComponentSymbol is { path = ${path:String}, type = ${type:String} };
tagtype TrainingConfigDataPath for ComponentSymbol is { CNNTrainModel = ${CNNTrainModel:String} };
tagtype PreTrainedModelWeightsDataPath for ComponentSymbol is { path = ${path:String}, fileName = ${type:String} };
tagtype DataPath for ComponentInstanceSymbol is { path = ${path:String}, type = ${type:String} };
tagtype TrainingConfigDataPath for ComponentInstanceSymbol is { CNNTrainModel = ${CNNTrainModel:String} };
tagtype PreTrainedModelWeightsDataPath for ComponentInstanceSymbol is { path = ${path:String}, fileName = ${type:String} };
}
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