ConstantArrayLayer
represents a layer that has no input and produces as output a constant array.
ConstantArrayLayer[opts]
includes options for initial value of the array or output size.
Details and Options

- ConstantArrayLayer is typically used in a NetGraph and allows a learned array to be used as an ordinary input to other layers. Without ConstantArrayLayer, all layer inputs must ultimately be derived from inputs to the entire net.
- The array stored by ConstantArrayLayer will be learned during training.
- The constant array stored in ConstantArrayLayer has the same dimensions as the output of ConstantArrayLayer.
- ConstantArrayLayer["Array"->array] can be used to give an explicit value of the constant array.
- ConstantArrayLayer["Output"->{d1,d2,…}] can be used to fix the output size of the layer, which also fixes the size of the constant array.
- When the constant array is not explicitly specified or is given as Automatic, it is added automatically when NetInitialize or NetTrain is used.
- ConstantArrayLayer[…][] returns the constant array.
- The constant array can also be obtained from an initialized ConstantArrayLayer using NetExtract[layer,"Array"].
Examples
open all close allBasic Examples (2)
Create a ConstantArrayLayer:
Create an initialized ConstantArrayLayer with output dimensions specified:
Scope (1)
Possible Issues (1)
Introduced in 2017
(11.1)