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.
  • Options[TotalLayer] gives the list of default options to construct the layer. Options[TotalLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[TotalLayer[]] gives a report about the layer.
  • Information[TotalLayer[],prop] gives the value of the property prop of TotalLayer[]. Possible properties are the same as for NetGraph.


open allclose all

Basic Examples  (3)

Create a TotalLayer:

Create a TotalLayer with input dimension specified:

Apply the layer to a list of two vectors:

Construct a NetGraph with a TotalLayer that has two inputs:

Apply the layer to two vectors:

Scope  (2)

Create a TotalLayer that takes two matrices as input:

Create a TotalLayer that takes three real numbers as input, and apply it to a list:

Properties & Relations  (3)

TotalLayer computes:

Evaluate on some data:

TotalLayer[] is equivalent to ThreadingLayer[Plus]:

TotalLayer is similar to ConstantPlusLayer, except that ConstantPlusLayer adds a learned bias array to a single input, whereas TotalLayer performs elementwise addition of multiple inputs.

Possible Issues  (1)

TotalLayer cannot accept symbolic inputs:

Introduced in 2016
Updated in 2018