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
828967a3
Commit
828967a3
authored
Aug 09, 2021
by
lr119628
Browse files
[update] streamlining, removed unneccesary .ftl templates
parent
80d43a97
Pipeline
#524619
failed with stage
in 33 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/gluongenerator/CNNArch2GluonTemplateController.java
View file @
828967a3
...
...
@@ -88,8 +88,6 @@ public class CNNArch2GluonTemplateController extends CNNArchTemplateController {
this
.
worked_list
.
add
(
layer
.
getName
());
}
layer
.
setArtificial
(
originalArtificialState
);
}
else
{
include
(
TEMPLATE_ELEMENTS_DIR_PATH
,
"ArtificialArch"
,
writer
,
netDefinitionMode
);
}
}
else
{
include
((
ArchitectureElementSymbol
)
layer
.
getResolvedThis
().
get
(),
writer
,
netDefinitionMode
);
...
...
src/main/resources/templates/gluon/CNNNet.ftl
View file @
828967a3
...
...
@@ -13,6 +13,8 @@ from mxnet import gluon, nd
from mxnet.gluon import nn, HybridBlock
from numpy import log, product,prod,sqrt
from mxnet.ndarray import zeros,zeros_like
sys.path.insert(1, '${tc.architecture.getAdaNetUtils()}')
from AdaNetConfig import AdaNetConfig
</#if>
<#if tc.architecture.customPyFilesPath??>
sys.path.insert(1, '${tc.architecture.customPyFilesPath}')
...
...
@@ -550,22 +552,24 @@ class Net_${networkInstruction?index}(gluon.HybridBlock):
return self.dummy(x)
class DataClass_${networkInstruction?index}:
"""
this object holds all the necessary information for AdaNet
"""
def __init__(self, **kwargs):
FullyConnected = AdaNetConfig.DEFAULT_BLOCK.value
<#if outblock.isPresent()>
self.outBlock = ${
tc.include(
outblock.get()
,"ADANET_CONSTRUCTION")
}
self.outBlock = ${outblock.get()
.name
}
<#else>
self.outBlock = None
</#if>
<#if inblock.isPresent()>
self.inBlock = ${
tc.include(
inblock.get()
,"ADANET_CONSTRUCTION")
}
self.inBlock = ${inblock.get()
.name
}
<#else>
self.inBlock = None
</#if>
<#if block.isPresent()>
self.block = ${
tc.include(block.get(),"ADANET_CONSTRUCTION")
}
self.block = ${
block.get().name
}
<#else>
self.block = None
</#if>
...
...
src/main/resources/templates/gluon/elements/ArtificialArch.ftl
deleted
100644 → 0
View file @
80d43a97
<#assign name = element.element.name>
<#if mode == "ADANET_CONSTRUCTION">
${name}
</#if>
\ No newline at end of file
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