Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit 227d975d authored by Christian Fuß's avatar Christian Fuß
Browse files

made all (necessary) layers share weigths in unrolls

parent 12b7f4ef
Pipeline #179464 failed with stages
in 3 minutes and 25 seconds
......@@ -3,10 +3,18 @@
<#if element.padding??>
self.${element.name}padding = Padding(padding=(${tc.join(element.padding, ",")}))
</#if>
<#if element.partOfUnroll>
self.${element.name} = gluon.nn.Conv2D(channels=${element.channels?c},
kernel_size=(${tc.join(element.kernel, ",")}),
strides=(${tc.join(element.stride, ",")}),
use_bias=${element.noBias?string("False", "True")},
params=Net_${element.unrollIndex + tc.architecture.streams?size}().${element.name}.collect_params())
<#else>
self.${element.name} = gluon.nn.Conv2D(channels=${element.channels?c},
kernel_size=(${tc.join(element.kernel, ",")}),
strides=(${tc.join(element.stride, ",")}),
use_bias=${element.noBias?string("False", "True")})
</#if>
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
<#if element.padding??>
......
<#assign input = element.inputs[0]>
<#if mode == "ARCHITECTURE_DEFINITION">
<#if element.partOfUnroll>
${element.name} = Net_1.${element.name}(${input})
self.${element.name} = gluon.nn.Embedding(input_dim=${element.inputDim?c}, output_dim=${element.outputDim?c},
params=Net_${element.unrollIndex + tc.architecture.streams?size}().${element.name}.collect_params())
<#else>
self.${element.name} = gluon.nn.Embedding(input_dim=${element.inputDim?c}, output_dim=${element.outputDim?c})
</#if>
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
<#if element.partOfUnroll>
${element.name} = Net_1.${element.name}(${input})
<#else>
${element.name} = self.${element.name}(${input})
</#if>
</#if>
\ No newline at end of file
......@@ -4,8 +4,8 @@
<#assign flatten = element.flatten?string("True","False")>
<#if mode == "ARCHITECTURE_DEFINITION">
<#if element.partOfUnroll>
<#assign unrollIndex = element.unrollIndex>
self.${element.name} = gluon.nn.Dense(units=${units}, use_bias=${use_bias}, flatten=${flatten}, params=Net_${unrollIndex + tc.architecture.streams?size}().${element.name}.collect_params())
self.${element.name} = gluon.nn.Dense(units=${units}, use_bias=${use_bias}, flatten=${flatten},
params=Net_${element.unrollIndex + tc.architecture.streams?size}().${element.name}.collect_params())
<#else>
self.${element.name} = gluon.nn.Dense(units=${units}, use_bias=${use_bias}, flatten=${flatten})
</#if>
......
......@@ -146,7 +146,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test
public void testRNNtest() throws IOException, TemplateException {
Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/architectures", "-r", "RNNtest", "-o", "./target/generated-sources-cnnarch/"};
String[] args = {"-m", "src/test/resources/valid_tests", "-r", "RNNtest", "-o", "./target/generated-sources-cnnarch/"};
CNNArch2GluonCli.main(args);
assertTrue(Log.getFindings().isEmpty());
}
......
architecture RNNtest(max_length=50, vocabulary_size=30001, hidden_size=500) {
def input Q(-oo:oo)^{max_length, vocabulary_size} source[2]
def output Q(-oo:oo)^{max_length, vocabulary_size} target[2]
layer RNN(units=hidden_size, layers=2) encoder;
layer RNN(units=hidden_size, layers=2) decoder;
source[0] ->
encoder;
encoder.output ->
target[0];
encoder.state ->
decoder.state;
source[1] ->
decoder ->
target[1];
}
......@@ -3,5 +3,4 @@ CifarClassifierNetwork data/CifarClassifierNetwork
ThreeInputCNN_M14 data/ThreeInputCNN_M14
Alexnet data/Alexnet
MultipleOutputs data/MultipleOutputs
ResNeXt50 data/ResNeXt50
RNNtest data/RNNtest
\ No newline at end of file
ResNeXt50 data/ResNeXt50
\ No newline at end of file
architecture RNNencdec(max_length=5, vocabulary_size=30000, hidden_size=1000){
def input Q(0:1)^{vocabulary_size} source
def output Q(0:1)^{vocabulary_size} target[6]
source -> Softmax() -> target[0];
timed <t=0> BeamSearchStart(max_length=5) {
source ->
FullyConnected(units=vocabulary_size) ->
Softmax() ->
target[t+1]
};
}
\ No newline at end of file
architecture RNNencdec(max_length=50, vocabulary_size=30000, hidden_size=1000){
def input N(0:29999)^{50} source
def output Q(0:29999)^{1} target[50]
layer LSTM(units=hidden_size) encoder;
source ->
Embedding(output_dim=hidden_size) ->
encoder;
layer LSTM(units=hidden_size) decoder;
1 -> target[0];
encoder.state -> decoder.state;
timed<t=1> BeamSearchStart(max_length=50) {
target[t-1] ->
Embedding(output_dim=hidden_size) ->
decoder ->
FullyConnected(units=vocabulary_size) ->
Softmax() ->
target[t]
};
}
\ No newline at end of file
architecture RNNtest(max_length=50, vocabulary_size=30000, hidden_size=1000){
def input Q(0:1)^{vocabulary_size} source
def output Q(0:1)^{vocabulary_size} target[5]
source -> Softmax() -> target[0];
timed <t=1> BeamSearchStart(max_length=5){
(target[0] | target[t-1]) ->
Concatenate() ->
FullyConnected(units=30000) ->
Softmax() ->
target[t]
};
}
\ No newline at end of file
......@@ -5,4 +5,5 @@ Alexnet data/Alexnet
ResNeXt50 data/ResNeXt50
MultipleStreams data/MultipleStreams
Invariant data/Invariant
RNNencdec data/RNNencdec
\ No newline at end of file
RNNencdec data/RNNencdec
RNNtest data/RNNtest
\ 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