Hidden layer activations with Neural Network Toolbox
Mostra commenti meno recenti
Hello,
I have recently started using Matlab's Neural Network Toolbox, after some years of working with Netlab. Does anybody know how to get the activations (=output of the transfer function) of the hidden layers?
So if I create a 4-2-4 network:
net = feedforwardnet(2,'trainlm');
net = configure(net,randn(4,10),randn(4,10));
inp = randn(4,1);
out = sim(net, inp);
How can I then find the output of the hidden layer?
Regards,
Martijn
Risposta accettata
Più risposte (2)
Martijn Onderwater
il 23 Set 2011
0 voti
HunterE
il 25 Ago 2016
0 voti
You can also use genFunction to generate a .m file which should exactly reproduce the model in your net object. Then you can edit the resulting .m file to cause it to return the activations. For larger networks this is more practical than re-coding it yourself.
However, is there really no easier way to access the hidden layer activations??? If so this is a serious oversight!!
Categorie
Scopri di più su Installing Products in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!