Commit 637fc715 authored by Christian Fuß's avatar Christian Fuß
Browse files

fixed naming Nets in CNNNET.ftl

parent fba1a685
Pipeline #175291 failed with stages
in 18 seconds
...@@ -109,9 +109,12 @@ public class CNNArch2GluonTemplateController extends CNNArchTemplateController { ...@@ -109,9 +109,12 @@ public class CNNArch2GluonTemplateController extends CNNArchTemplateController {
include(unrollElement.getBody().getElements().get(0).getResolvedThis().get(), writer, netDefinitionMode); include(unrollElement.getBody().getElements().get(0).getResolvedThis().get(), writer, netDefinitionMode);
} }
for(int i = 0; i < (int)unrollElement.getIntValue(AllPredefinedLayers.BEAMSEARCH_MAX_LENGTH).get(); i++) { //System.err.println("TIME: " + unrollElement.getIntValue(AllPredefinedLayers.BEAMSEARCH_T_NAME).get());
int timestep = 0;//unrollElement.getIntValue(AllPredefinedLayers.BEAMSEARCH_T_NAME).get();
System.err.println("i: " + i); while (timestep < unrollElement.getIntValue(AllPredefinedLayers.BEAMSEARCH_MAX_LENGTH).get()) {
System.err.println("i: " + timestep);
for (ArchitectureElementSymbol element : unrollElement.getBody().getElements()) { for (ArchitectureElementSymbol element : unrollElement.getBody().getElements()) {
previousElement = getCurrentElement(); previousElement = getCurrentElement();
...@@ -126,6 +129,7 @@ public class CNNArch2GluonTemplateController extends CNNArchTemplateController { ...@@ -126,6 +129,7 @@ public class CNNArch2GluonTemplateController extends CNNArchTemplateController {
} }
} }
} }
timestep++;
} }
......
...@@ -96,23 +96,7 @@ ${tc.include(stream, "FORWARD_FUNCTION")} ...@@ -96,23 +96,7 @@ ${tc.include(stream, "FORWARD_FUNCTION")}
<#list tc.architecture.unrolls as unroll> <#list tc.architecture.unrolls as unroll>
<#if unroll.isTrainable()> <#if unroll.isTrainable()>
class Net_${unroll?index}(gluon.HybridBlock): class Net_${tc.architecture.streams?size + unroll?index}(gluon.HybridBlock):
def __init__(self, data_mean=None, data_std=None, **kwargs):
super(Net_${unroll?index}, self).__init__(**kwargs)
self.last_layers = {}
with self.name_scope():
${tc.include(unroll, "ARCHITECTURE_DEFINITION")}
def hybrid_forward(self, F, ${tc.join(tc.getUnrollInputNames(unroll), ", ")}):
${tc.include(unroll, "FORWARD_FUNCTION")}
return ${tc.join(tc.getUnrollOutputNames(unroll), ", ")}
</#if>
</#list>
<#list tc.architecture.unrolls as unroll>
<#if unroll.isTrainable()>
class Net_${unroll?index}(gluon.HybridBlock):
def __init__(self, data_mean=None, data_std=None, **kwargs): def __init__(self, data_mean=None, data_std=None, **kwargs):
super(Net_${unroll?index}, self).__init__(**kwargs) super(Net_${unroll?index}, self).__init__(**kwargs)
self.last_layers = {} self.last_layers = {}
......
architecture RNNencdec(max_length=5, vocabulary_size=30000, hidden_size=1000){ architecture RNNencdec(max_length=5, vocabulary_size=30000, hidden_size=1000){
def input Q(0:1)^{vocabulary_size} source def input Q(0:1)^{vocabulary_size} source
def output Q(0:1)^{vocabulary_size} target def output Q(0:1)^{vocabulary_size} target[3]
timed <t> BeamSearchStart(max_length=5) { source -> target[0];
source ->
timed <t=2> BeamSearchStart(max_length=5) {
target[t-1] ->
FullyConnected(units=vocabulary_size) -> FullyConnected(units=vocabulary_size) ->
Softmax() -> Softmax() ->
target target[t]
}; };
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment