TotalLayer
represents a net layer taking a list of input tensors and performing elementwise addition on them.
Details and Options
- TotalLayer has a single input port that must be a list of tensors.
- 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 TotalLayer, or as a multiple separate edges given in the corresponding order, as src1->totlayer,…,src2totlayer,….
- TotalLayer[…][{tensor1,tensor2,…}] explicitly computes the output given a list of tensori.
- TotalLayer is typically used inside NetGraph.
- TotalLayer exposes the following ports for use in NetGraph etc.:
-
"Input" a list of tensors of arbitrary but equal dimensions "Output" a tensor of the same dimension as the inputs - When it cannot be inferred from other layers in a larger net, the option "Input"{shape1,shape2,…} can be used to fix the dimensions of the input tensors to TotalLayer. Each shape can be one of the following:
-
"Real" a single real number {d1,d2,…} a tensor of dimensions d1×d2×…
Examples
open allclose allBasic 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:
Scope (2)
Properties & Relations (2)
Possible Issues (1)
See Also
AggregationLayer SummationLayer ConstantPlusLayer CatenateLayer NetChain NetGraph NetTrain
Related Guides
Introduced in 2016
(11.0)