represents a net in which net is applied n times to the input.

Details and Options

  • NetNestOperator[net,n] accepts a single input array s0 and produces an output array sn, computed by applying net repeatedly to si-1 to compute si .
  • In NetNestOperator[net,n], net should take exactly one input and produce exactly one output. The input and output must be of the same dimensions.
  • NetNestOperator exposes the following ports for use in NetGraph etc.:
  • "Input"the initial state s0
    "Output"the final state sn
  • If net contains trainable parameters, the same parameters are used for every application of net to the input.
  • If net has no trainable parameters, NetNestOperator[net,n] is equivalent to a NetChain containing n copies of net.


open all close all

Basic Examples  (1)

Create a net that applies a LinearLayer 10 times:

Click for copyable input

Randomly initialize the net and apply it to an input:

Click for copyable input

Neat Examples  (1)

Introduced in 2017