LSTM.ftl 658 Bytes
Newer Older
Sebastian N.'s avatar
Sebastian N. committed
1
2
<#assign input = element.inputs[0]>
<#if mode == "ARCHITECTURE_DEFINITION">
3
            self.${element.name} = CustomLSTM(hidden_size=${element.units?c},
4
                num_layers=${element.layers?c},
5
                bidirectional=${element.bidirectional?string("True", "False")})
Sebastian N.'s avatar
Sebastian N. committed
6
7
            <#include "OutputShape.ftl">
<#elseif mode == "FORWARD_FUNCTION">
8
<#if element.isVariable()>
9
        ${element.name}, ${element.element.name}_state_0_, ${element.element.name}_state_1_ = self.${element.name}(${input}, ${element.element.name}_state_0_, ${element.element.name}_state_1_)
10
11
12
<#else>
        ${element.name} = self.${element.name}(${input})
</#if>
Sebastian N.'s avatar
Sebastian N. committed
13
</#if>