Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2Gluon
Commits
7add7fcd
Commit
7add7fcd
authored
Jul 23, 2021
by
lr119628
Browse files
[update] update
parent
30fdf01a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/resources/templates/gluon/CNNCreator.ftl
View file @
7add7fcd
...
...
@@ -16,7 +16,7 @@ from custom_layers import *
<#
list
tc.architecture.networkInstructions as networkInstruction>
<#
if
tc.containsAdaNet()>
from
CNNNet_$
{
tc
.fullArchitectureName
}
import Net_$
{
networkInstruction
?
index
}
,DataClass
from
CNNNet_$
{
tc
.fullArchitectureName
}
import Net_$
{
networkInstruction
?
index
}
,DataClass
_$
{
networkInstruction
?
index
}
<#
else
>
from
CNNNet_$
{
tc
.fullArchitectureName
}
import Net_$
{
networkInstruction
?
index
}
</#
if
>
...
...
@@ -178,8 +178,8 @@ class ${tc.fileNameWithoutEnding}:
def construct(self, context, data_mean=None, data_std=None):
<#
list
tc.architecture.networkInstructions as networkInstruction>
<#if tc.containsAdaNet()>
self.networks[$
{
networkInstruction
?
index
}
] = Net_$
{
networkInstruction
?
index
}
(prefix="")
self.dataClass = DataC
L
ass()
self.networks[$
{
networkInstruction
?
index
}
] = Net_$
{
networkInstruction
?
index
}
(prefix=""
,operations=None
)
self.dataClass = DataC
l
ass
_$
{
networkInstruction
?
index
}
()
<#else>
self.networks[$
{
networkInstruction
?
index
}
] = Net_$
{
networkInstruction
?
index
}
(data_mean=data_mean, data_std=data_std, mx_context=context, prefix="")
</#if>
...
...
src/main/resources/templates/gluon/CNNNet.ftl
View file @
7add7fcd
...
...
@@ -570,11 +570,10 @@ class Net_${networkInstruction?index}(gluon.HybridBlock):
mean_complexity[i] = self.candidate_complexities[name]
return mean_complexity
class
DataClass
()
:
class
DataClass
_$
{
networkInstruction
?
index
}
:
"""
the whole model with its operations
"""
def __init__(self,
**
kwargs):
self.op_names = [] # list that holds the name of the added operations
self.candidate_complexities =
{}
...
...
Write
Preview
Supports
Markdown
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