TotalLayer

TotalLayer[]

represents a net layer taking a list of input arrays and performing elementwise addition on them.

Details and Options

  • TotalLayer is typically used inside NetGraph.
  • TotalLayer has an arbitrary number of input ports named 1, 2, etc.
  • Within a NetGraph, a TotalLayer can be connected using a single edge of the form {src1,src2,}totlayer, where totlayer is the name or index of the ThreadingLayer, or as multiple separate edges given in the corresponding order, as src1totlayer,src2totlayer,,srcntotlayer.
  • TotalLayer[][{input1,input2,}] explicitly computes the output given a list of inputi. The output is effectively given by input1+input2+.
  • TotalLayer exposes the following ports for use in NetGraph etc.:
  • 1,2,arrays
    "Output"an array
  • The option "Inputs"->n can be used to fix the number of inputs to Totallayer.
  • When it cannot be inferred from other layers in a larger net, the option "Output"{d1,d2,} can be used to fix the dimensions of the output of the TotalLayer. All inputs will also have their dimensions fixed to the same value.

Examples

open all close all

Basic Examples  (3)

Create a TotalLayer:

In[1]:=
Click for copyable input
Out[1]=

Create a TotalLayer with input dimension specified:

In[1]:=
Click for copyable input
Out[1]=

Apply the layer to a list of two vectors:

In[2]:=
Click for copyable input
Out[2]=

Construct a NetGraph with a TotalLayer that has two inputs:

In[1]:=
Click for copyable input
Out[1]=

Apply the layer to two vectors:

In[2]:=
Click for copyable input
Out[2]=

Scope  (2)

Properties & Relations  (3)

Possible Issues  (1)

Introduced in 2016
(11.0)
|
Updated in 2018
(11.3)