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.
  • The following training parameter can be included:
  • LearningRateMultipliersAutomaticlearning rate multipliers for trainable arrays in the net
  • NetExtract allows access to the forward and reverse nets via "Net".
  • Options[NetNestOperator] gives the list of default options to construct the operator. Options[NetNestOperator[]] gives the list of default options to evaluate the operator on some data.
  • Information[NetNestOperator[]] gives a report about the operator.
  • Information[NetNestOperator[],prop] gives the value of the property prop of NetNestOperator[]. Possible properties are the same as for NetGraph.


open allclose all

Basic Examples  (1)

Create a net that applies a LinearLayer 10 times:

Randomly initialize the net and apply it to an input:

Neat Examples  (1)

Distort an image by nesting convolutions and poolings. First, create a chain that applies a convolution, pooling and a nonlinearity:

Create a net the applies the chain 30 times:

Randomly initialize the net and apply it to a test image:

Create a gallery of the results from different random initializations:

Introduced in 2017
Updated in 2020