I've learned in a recent Virtual Conference that I can use Take
to get a subnetwork from a neural network object, so e.g.
net = NetChain[{5, LogisticSigmoid, 6, LogisticSigmoid, 7}];
Take[net,2]
will return a new neural network with only the first two layers of net
. Take[net,-2]
will get me the last two layers. This seems to be undocumented (at least in Take
and in the neural networks overview), but very useful.
So far, I've only found Drop
and TakeDrop
work on neural nets. Part
, Join
, Append
or Flatten
all don't work.
Are there any other useful functions for manipulating networks? For example, adding layers to an existing net (the inverse of Take
) or joining two networks (the inverse of TakeDrop
) would seem like useful operations. (e.g. to train each layer as an autoencoder, then remove the encoder "backend" and add the next layer.)
Take
andDrop
are mentioned in the docs forNetChain
. No other functions are mention, as far as I saw. $\endgroup$