# What non-obvious functions work on neural network objects?

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 and Drop are mentioned in the docs for NetChain. No other functions are mention, as far as I saw. Dec 7, 2016 at 3:08

If you inspect the output of UpValues[NetChain] and UpValues[NetGraph] besides the Take and Drop there are only Normal and VertexDelete functions it seems.