Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
CNNArch2X
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2X
Commits
000ef532
Commit
000ef532
authored
Apr 13, 2020
by
Evgeny Kusmenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'master'
Develop See merge request
!10
parents
44088e98
30a2400e
Pipeline
#267730
passed with stage
in 2 minutes and 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
src/main/java/de/monticore/lang/monticar/cnnarch/generator/CNNArchGenerator.java
...ore/lang/monticar/cnnarch/generator/CNNArchGenerator.java
+10
-3
src/main/java/de/monticore/lang/monticar/cnnarch/generator/WeightsPathConfigParser.java
...g/monticar/cnnarch/generator/WeightsPathConfigParser.java
+1
-1
src/test/java/de/monticore/lang/monticar/cnnarch/generator/WeightsPathConfigParserTest.java
...nticar/cnnarch/generator/WeightsPathConfigParserTest.java
+0
-9
No files found.
src/main/java/de/monticore/lang/monticar/cnnarch/generator/CNNArchGenerator.java
View file @
000ef532
...
...
@@ -14,6 +14,7 @@ import de.se_rwth.commons.logging.Log;
import
java.io.IOException
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -74,9 +75,15 @@ public abstract class CNNArchGenerator {
DataPathConfigParser
dataParserConfig
=
new
DataPathConfigParser
(
dataConfPath
);
String
dataPath
=
dataParserConfig
.
getDataPath
(
rootModelName
);
architectureSymbol
.
setDataPath
(
dataPath
);
String
weightsConfPath
=
getModelsDirPath
()
+
"/weights_paths.txt"
;
WeightsPathConfigParser
weightsParserConfig
=
new
WeightsPathConfigParser
(
weightsConfPath
);
String
weightsPath
=
weightsParserConfig
.
getWeightsPath
(
rootModelName
);
Path
weightsConfPath
=
Paths
.
get
(
getModelsDirPath
()
+
"/weights_paths.txt"
);
String
weightsPath
=
null
;
if
(
weightsConfPath
.
toFile
().
exists
())
{
WeightsPathConfigParser
weightsParserConfig
=
new
WeightsPathConfigParser
(
getModelsDirPath
()
+
"/weights_paths.txt"
);
weightsPath
=
weightsParserConfig
.
getWeightsPath
(
rootModelName
);
}
else
{
Log
.
info
(
"No weights path definition found in "
+
weightsConfPath
+
" found: "
+
"No pretrained weights will be loaded."
,
"CNNArchGenerator"
);
}
architectureSymbol
.
setWeightsPath
(
weightsPath
);
architectureSymbol
.
setComponentName
(
rootModelName
);
generateFiles
(
architectureSymbol
);
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/generator/WeightsPathConfigParser.java
View file @
000ef532
...
...
@@ -37,7 +37,7 @@ public class WeightsPathConfigParser{
public
String
getWeightsPath
(
String
modelName
)
{
String
path
=
properties
.
getProperty
(
modelName
);
if
(
path
==
null
)
{
Log
.
warn
(
"Weights path config file did not specify a path for component '"
+
modelName
+
"'
"
);
Log
.
info
(
"Weights path config file did not specify a path for component '"
+
modelName
+
"'"
,
"WeightsPathConfigParser
"
);
return
path
;
}
return
path
;
...
...
src/test/java/de/monticore/lang/monticar/cnnarch/generator/WeightsPathConfigParserTest.java
View file @
000ef532
...
...
@@ -29,15 +29,6 @@ public class WeightsPathConfigParserTest extends AbstractSymtabTest {
assertTrue
(
"Wrong weights path returned"
,
weights_path
.
equals
(
"/path/to/training/weights"
));
}
@Test
public
void
testWeightsPathConfigParserInvalidComponent
()
{
WeightsPathConfigParser
parser
=
new
WeightsPathConfigParser
(
"src/test/resources/architectures/weights_paths.txt"
);
String
weights_path
=
parser
.
getWeightsPath
(
"NotExistingComponent"
);
assertTrue
(
"For not listed components, null should be returned"
,
weights_path
==
null
);
assertTrue
(
Log
.
getFindings
().
size
()
==
1
);
}
@Test
public
void
testWeightsPathConfigParserInvalidPath
()
{
WeightsPathConfigParser
parser
=
new
WeightsPathConfigParser
(
"invalid/path/weights_paths.txt"
);
...
...
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