Commit 94d3b4a8 authored by Sebastian N.'s avatar Sebastian N.
Browse files

Fixed a bug which caused that RNNs could not be used without variable

parent 4fa36a95
<#if element.member == "NONE">
<#assign input = element.inputs[0]>
<#if mode == "ARCHITECTURE_DEFINITION">
self.rnn_${element.element.name} = gluon.rnn.GRU(hidden_size=${element.units?c}, num_layers=${element.layers?c}, layout='NTC')
self.${element.name} = gluon.rnn.GRU(hidden_size=${element.units?c}, num_layers=${element.layers?c}, layout='NTC')
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
${element.name}, ${element.element.name}_state_ = self.rnn_${element.element.name}(${input}, ${element.element.name}_state_)
<#if element.isVariable()>
${element.name}, ${element.element.name}_state_ = self.${element.name}(${input}, ${element.element.name}_state_)
<#else>
${element.name} = self.${element.name}(${input})
</#if>
</#if>
<#elseif element.member == "STATE">
<#if element.inputs?size gte 1>
......
<#if element.member == "NONE">
<#assign input = element.inputs[0]>
<#if mode == "ARCHITECTURE_DEFINITION">
self.rnn_${element.element.name} = gluon.rnn.LSTM(hidden_size=${element.units?c}, num_layers=${element.layers?c}, layout='NTC')
self.${element.name} = gluon.rnn.LSTM(hidden_size=${element.units?c}, num_layers=${element.layers?c}, layout='NTC')
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
${element.name}, ${element.element.name}_state_ = self.rnn_${element.element.name}(${input}, ${element.element.name}_state_)
<#if element.isVariable()>
${element.name}, ${element.element.name}_state_ = self.${element.name}(${input}, ${element.element.name}_state_)
<#else>
${element.name} = self.${element.name}(${input})
</#if>
</#if>
<#elseif element.member == "STATE">
<#if element.inputs?size gte 1>
......
<#if element.member == "NONE">
<#assign input = element.inputs[0]>
<#if mode == "ARCHITECTURE_DEFINITION">
self.rnn_${element.element.name} = gluon.rnn.RNN(hidden_size=${element.units?c}, num_layers=${element.layers?c}, activation='tanh', layout='NTC')
self.${element.name} = gluon.rnn.RNN(hidden_size=${element.units?c}, num_layers=${element.layers?c}, activation='tanh', layout='NTC')
<#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
${element.name}, ${element.element.name}_state_ = self.rnn_${element.element.name}(${input}, ${element.element.name}_state_)
<#if element.isVariable()>
${element.name}, ${element.element.name}_state_ = self.${element.name}(${input}, ${element.element.name}_state_)
<#else>
${element.name} = self.${element.name}(${input})
</#if>
</#if>
<#elseif element.member == "STATE">
<#if element.inputs?size gte 1>
......
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