4

How can one copy specified layers from a pre-trained neural network and add them to another trained neural net?

For instance,

net1 = NetModel["LeNet Trained on MNIST Data"]

net1

and net2 has a similar structure but it has been trained on a different dataset (however, to keep things simple for this question we can set net2 = net1). How should one go about taking layers 4, 5, 6 from net1 and replace layers 4, 5, 6 in net2, fix their variable so they would not change during the training process, and train net2 on some dataset?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Miladiouss
  • 1,883
  • 11
  • 26

0 Answers0