Updated layer templates for Input and Output

parent 708625a4
...@@ -9,11 +9,10 @@ ...@@ -9,11 +9,10 @@
${element.name} = data ${element.name} = data
<#include "OutputShape.ftl"> <#include "OutputShape.ftl">
<#if heightIndex != channelIndex + 1 || widthIndex != heightIndex + 1> <#if heightIndex != channelIndex + 1 || widthIndex != heightIndex + 1>
${element.name} = mx.symbol.transpose(data=${element.name},mx.sym.var <#-- TODO: check how to adapt CNNArchLang transpose case --> ${element.name} = model.net.Transpose(${element.name}, '${element.name}', axes=[0,${tc.join(indexList, ",")}])
axes=(0,${tc.join(indexList, ",")}))
</#if> </#if>
<#if indexList?size != 3> <#if indexList?size != 3>
${element.name} = mx.symbol.reshape(data=${element.name}, <#-- TODO: check how to adapt CNNArchLang transpose case --> ${element.name}, _ = model.net.Reshape('${element.name}', ['${element.name}', '${element.name}_old_shape'],
shape=(0,${element.element.outputTypes[0].channels?c},${element.element.outputTypes[0].height?c},${element.element.outputTypes[0].width?c})) shape=(0,${element.element.outputTypes[0].channels?c},${element.element.outputTypes[0].height?c},${element.element.outputTypes[0].width?c}))
</#if> </#if>
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<#elseif element.logisticRegressionOutput> <#elseif element.logisticRegressionOutput>
${element.name} = model.net.Sigmoid(${input}, '${element.name}') ${element.name} = model.net.Sigmoid(${input}, '${element.name}')
<#elseif element.linearRegressionOutput> <#elseif element.linearRegressionOutput>
${element.name} = mx.symbol.LinearRegressionOutput(data=${element.inputs[0]}, <#-- TODO: check how to adapt linearRegressionOutput --> <#--Don't add L2 loss here but within the function "add_training_operators" from CNNCreator.ftl-->
name="${element.name}") ${element.name} = ${input}
</#if> </#if>
return ${element.name} return ${element.name}
\ 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