represents a net layer that sums all of its input elements.

Details and Options

  • SummationLayer[][input] explicitly computes the output from applying the layer.
  • SummationLayer[][{input1,input2,}] explicitly computes outputs for each of the inputi.
  • SummationLayer exposes the following ports for use in NetGraph etc.:
  • "Input"an array of arbitrary rank
    "Output"a real number
  • SummationLayer is typically used inside NetChain, NetGraph, etc.
  • When it cannot be inferred from other layers in a larger net, the option "Input"->{n1,n2,} can be used to fix the input dimensions of SummationLayer.
  • Options[SummationLayer] gives the list of default options to construct the layer. Options[SummationLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[SummationLayer[]] gives a report about the layer.
  • Information[SummationLayer[],prop] gives the value of the property prop of SummationLayer[]. Possible properties are the same as for NetGraph.


open allclose all

Basic Examples  (2)

Create a SummationLayer:

Create a SummationLayer with vector input of size 4:

Apply this layer to an input:

Scope  (1)

Create a SummationLayer that takes an input array of dimensions 2×3×1:

Apply this layer to an input:

The layer threads across a batch of examples:

Properties & Relations  (2)

SummationLayer computes:

Evaluate on some data:

SummationLayer[] is equivalent to AggregationLayer[Total,All]:

Possible Issues  (1)

SummationLayer cannot accept symbolic inputs:

Introduced in 2016