Add a new layer to pre-trained neural networks

2 views (last 30 days)
Hey,
I have three feed-forward neural networks in matlab:
...
[net1, tr1] = train(net1,X_train,Y_train) % First neural network
... // testing and evaluating net1
[net2, tr2] = train(net2,X_train,Y_train) % Second neural network
... // testing and evaluating net2
[net3, tr3] = train(net3,X_train,Y_train) % Second neural network
... // testing and evaluating net3
The neural networks are trained seprately. All NNs have the same architecture (122-25-1). I want to build a bigger neural network that adds a fully connected layer with softmax activation to the pretrained NNs, and train the new neural network on the new parameters and keep the "old" layers untouched.
I want to create net4 that has a final output layer which connects the pretrained NNs. This layer has three neurons that are comming from the 3 NNs, and one output neuron (with softmax activation max). When I train net4, I only learn the parametrs of the created layer, and not change the learned parameters for net1, net2 and net3.
Thank you for your help,
Bests,

Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!