NetArrayLayer
represents a layer that has no input and produces as output a constant array.
NetArrayLayer[opts]
includes options for the initial value of the array or output size.
Details and Options
- NetArrayLayer is typically used in a NetGraph and allows a learned array to be used as an ordinary input to other layers. Without NetArrayLayer, all layer inputs must ultimately be derived from inputs to the entire net.
- The array stored by NetArrayLayer will be learned during training.
- The constant array stored in NetArrayLayer has the same dimensions as the output of NetArrayLayer.
- NetArrayLayer["Array"->array] can be used to give an explicit value 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.
- NetArrayLayer["Output"->{d1,d2,…}] can be used to fix the output size of the layer, which also fixes the size of the constant array.
- The following training parameter can also be included:
-
LearningRateMultipliers Automatic learning rate multipliers for the array - NetArrayLayer[…][] returns the constant array.
- The constant array can also be obtained from an initialized NetArrayLayer using NetExtract[layer,"Array"].
- Options[NetArrayLayer] gives the list of default options to construct the layer. Options[NetArrayLayer[…]] gives the list of default options to evaluate the layer on some data.
- Information[NetArrayLayer[…]] gives a report about the layer.
- Information[NetArrayLayer[…],prop] gives the value of the property prop of NetArrayLayer[…]. Possible properties are the same as for NetGraph.
- Neural Networks in the Wolfram Language
NetArray FunctionLayer RandomArrayLayer ThreadingLayer NetChain NetGraph NetInitialize NetTrain NetExtract
Create a NetArrayLayer:
Create an initialized NetArrayLayer with output dimensions specified:
Extract the initialized array:
Create a NetArrayLayer with a specific initial value for the array:
Embed the layer in a graph that raises the input to a power of the array elementwise:
NetArrayLayer cannot accept symbolic arrays:
Text
Wolfram Research (2020), NetArrayLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/NetArrayLayer.html.
CMS
Wolfram Language. 2020. "NetArrayLayer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NetArrayLayer.html.
APA
Wolfram Language. (2020). NetArrayLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetArrayLayer.html