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
CNNArch2Gluon
Commits
287791c5
Commit
287791c5
authored
Feb 25, 2019
by
Evgeny Kusmenko
Browse files
Merge branch 'oneclick_nn_training' into 'master'
Oneclick nn training See merge request
!10
parents
79e523d7
0d590982
Pipeline
#107586
passed with stages
in 4 minutes and 6 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
287791c5
...
...
@@ -8,16 +8,16 @@
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
cnnarch-gluon-generator
</artifactId>
<version>
0.1.
2
-SNAPSHOT
</version>
<version>
0.1.
3
-SNAPSHOT
</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<!-- .. SE-Libraries .................................................. -->
<CNNArch.version>
0.
2.9
</CNNArch.version>
<CNNArch.version>
0.
3.0-SNAPSHOT
</CNNArch.version>
<CNNTrain.version>
0.2.6
</CNNTrain.version>
<CNNArch2MXNet.version>
0.2.1
3
-SNAPSHOT
</CNNArch2MXNet.version>
<CNNArch2MXNet.version>
0.2.1
4
-SNAPSHOT
</CNNArch2MXNet.version>
<embedded-montiarc-math-opt-generator>
0.1.4
</embedded-montiarc-math-opt-generator>
<!-- .. Libraries .................................................. -->
...
...
src/main/resources/templates/gluon/CNNCreator.ftl
View file @
287791c5
...
...
@@ -20,9 +20,9 @@ class MyConstant(mx.init.Initializer):
class
$
{
tc
.fileNameWithoutEnding
}
:
_data_dir_ = "
data/$
{
tc
.fullArchitectureName
}
/
"
_model_dir_ = "model/$
{
tc
.
fullArchitecture
Name
}
/"
_model_prefix_ = "
$
{
tc
.architectureName
}
"
_data_dir_ = "
$
{
tc
.dataPath
}
"
_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/gluon/CNNPredictor.ftl
View file @
287791c5
...
...
@@ -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
>
}
;
...
...
src/test/resources/architectures/data_paths.txt
0 → 100644
View file @
287791c5
VGG16 data/VGG16/
CifarClassifierNetwork data/CifarClassifierNetwork/
ThreeInputCNN_M14 data/ThreeInputCNN_M14/
Alexnet data/Alexnet/
MultipleOutputs data/MultipleOutputs/
ResNeXt50 data/ResNeXt50/
\ No newline at end of file
src/test/resources/target_code/CNNCreator_Alexnet.py
View file @
287791c5
...
...
@@ -22,7 +22,7 @@ class CNNCreator_Alexnet:
_data_dir_
=
"data/Alexnet/"
_model_dir_
=
"model/Alexnet/"
_model_prefix_
=
"
Alexnet
"
_model_prefix_
=
"
model
"
_input_names_
=
[
'data'
]
_input_shapes_
=
[(
3
,
224
,
224
)]
_output_names_
=
[
'predictions_label'
]
...
...
src/test/resources/target_code/CNNCreator_CifarClassifierNetwork.py
View file @
287791c5
...
...
@@ -22,7 +22,7 @@ class CNNCreator_CifarClassifierNetwork:
_data_dir_
=
"data/CifarClassifierNetwork/"
_model_dir_
=
"model/CifarClassifierNetwork/"
_model_prefix_
=
"
CifarClassifierNetwork
"
_model_prefix_
=
"
model
"
_input_names_
=
[
'data'
]
_input_shapes_
=
[(
3
,
32
,
32
)]
_output_names_
=
[
'softmax_label'
]
...
...
src/test/resources/target_code/CNNCreator_VGG16.py
View file @
287791c5
...
...
@@ -22,7 +22,7 @@ class CNNCreator_VGG16:
_data_dir_
=
"data/VGG16/"
_model_dir_
=
"model/VGG16/"
_model_prefix_
=
"
VGG16
"
_model_prefix_
=
"
model
"
_input_names_
=
[
'data'
]
_input_shapes_
=
[(
3
,
224
,
224
)]
_output_names_
=
[
'predictions_label'
]
...
...
src/test/resources/target_code/CNNPredictor_Alexnet.h
View file @
287791c5
...
...
@@ -11,8 +11,8 @@
class
CNNPredictor_Alexnet
{
public:
const
std
::
string
json_file
=
"model/Alexnet/
Alexnet
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/Alexnet/
Alexnet
_newest-0000.params"
;
const
std
::
string
json_file
=
"model/Alexnet/
model
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/Alexnet/
model
_newest-0000.params"
;
//const std::vector<std::string> input_keys = {"data"};
const
std
::
vector
<
std
::
string
>
input_keys
=
{
"data"
};
const
std
::
vector
<
std
::
vector
<
mx_uint
>>
input_shapes
=
{{
1
,
3
,
224
,
224
}};
...
...
src/test/resources/target_code/CNNPredictor_CifarClassifierNetwork.h
View file @
287791c5
...
...
@@ -11,8 +11,8 @@
class
CNNPredictor_CifarClassifierNetwork
{
public:
const
std
::
string
json_file
=
"model/CifarClassifierNetwork/
CifarClassifierNetwork
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/CifarClassifierNetwork/
CifarClassifierNetwork
_newest-0000.params"
;
const
std
::
string
json_file
=
"model/CifarClassifierNetwork/
model
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/CifarClassifierNetwork/
model
_newest-0000.params"
;
//const std::vector<std::string> input_keys = {"data"};
const
std
::
vector
<
std
::
string
>
input_keys
=
{
"data"
};
const
std
::
vector
<
std
::
vector
<
mx_uint
>>
input_shapes
=
{{
1
,
3
,
32
,
32
}};
...
...
src/test/resources/target_code/CNNPredictor_VGG16.h
View file @
287791c5
...
...
@@ -11,8 +11,8 @@
class
CNNPredictor_VGG16
{
public:
const
std
::
string
json_file
=
"model/VGG16/
VGG16
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/VGG16/
VGG16
_newest-0000.params"
;
const
std
::
string
json_file
=
"model/VGG16/
model
_newest-symbol.json"
;
const
std
::
string
param_file
=
"model/VGG16/
model
_newest-0000.params"
;
//const std::vector<std::string> input_keys = {"data"};
const
std
::
vector
<
std
::
string
>
input_keys
=
{
"data"
};
const
std
::
vector
<
std
::
vector
<
mx_uint
>>
input_shapes
=
{{
1
,
3
,
224
,
224
}};
...
...
src/test/resources/valid_tests/data_paths.txt
0 → 100644
View file @
287791c5
VGG16 data/VGG16/
CifarClassifierNetwork data/CifarClassifierNetwork/
ThreeInputCNN_M14 data/ThreeInputCNN_M14/
Alexnet data/Alexnet/
MultipleOutputs data/MultipleOutputs/
ResNeXt50 data/ResNeXt50/
\ No newline at end of file
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