Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2MXNet
Commits
10de417f
Commit
10de417f
authored
Jan 31, 2019
by
nilsfreyer
Browse files
changed directory dependencies to componentName for weightsharing
parent
fc56ba27
Pipeline
#101587
failed with stages
in 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/mxnetgenerator/CNNArchTemplateController.java
View file @
10de417f
...
...
@@ -127,6 +127,10 @@ public class CNNArchTemplateController {
return
list
;
}
public
String
getComponentName
(){
return
getArchitecture
().
getComponentName
();
}
public
void
include
(
String
relativePath
,
String
templateWithoutFileEnding
,
Writer
writer
){
String
templatePath
=
relativePath
+
templateWithoutFileEnding
+
FTL_FILE_ENDING
;
Map
<
String
,
Object
>
ftlContext
=
new
HashMap
<>();
...
...
src/main/resources/templates/mxnet/CNNCreator.ftl
View file @
10de417f
...
...
@@ -19,8 +19,8 @@ class ${tc.fileNameWithoutEnding}:
module = None
_data_dir_ = "$
{
tc
.dataPath
}
/"
_model_dir_ = "model/$
{
tc
.
fullArchitecture
Name
}
/"
_model_prefix_ = "
$
{
tc
.architectureName
}
"
_model_dir_ = "model/$
{
tc
.
component
Name
}
/"
_model_prefix_ = "
model
"
_input_names_ = [$
{
tc
.join
(
tc
.architectureInputs
,
","
,
"'"
,
"'"
)}
]
_input_shapes_ = [<#list tc.architecture.inputs as input>($
{
tc
.join
(
input
.definition.type.dimensions
,
","
)}
)</#list>]
_output_names_ = [$
{
tc
.join
(
tc
.architectureOutputs
,
","
,
"'"
,
"_label'"
)}
]
...
...
src/main/resources/templates/mxnet/CNNPredictor.ftl
View file @
10de417f
...
...
@@ -11,8 +11,8 @@
class
$
{
tc
.fileNameWithoutEnding
}{
public
:
const
std
::
string
json_file
=
"model/${tc.
fullArchitectureName}/${tc.architectureName}
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/${tc.
fullArchitectureName}/${tc.architectureName}
_newest-0000.params"
;
const
std
::
string
json_file
=
"model/${tc.
componentName}/model
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/${tc.
componentName}/model
_newest-0000.params"
;
//
const
std
::
vector
<
std
::
string
>
input_keys
=
{
"data"
}
;
const
std
::
vector
<
std
::
string
>
input_keys
=
{
$
{
tc
.join
(
tc
.architectureInputs
,
","
,
"
\"
"
,
"
\"
"
)}}
;
const
std
::
vector
<
std
::
vector
<
mx_uint
>>
input_shapes
=
{
<#
list
tc
.architecture.inputs
as
input
>
{
1
,
$
{
tc
.join
(
input
.definition.type.dimensions
,
","
)}}
<#
if
input
?
has_next
>
,
</#
if
></#
list
>
}
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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