Modifing the weights of neural network by setting some weughts to zero
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Is there way to access the weights of deep neural networks and set some weights to zero of pretrained model then compute the accuracy of the model. I am working in a project and I need to do the following steps:
- train the model or download pretrained model
- Set some weights to zeros
- Do some computation (this is will be my work)
- Test the model again (without trian it again)
I tried those steps on the model pretrind myself using AutoencoderDigitsExample and accessed to the weights for example
autoenc1.EncoderWeights
but I could not modified the weights of the model when I did so
autoenc1.EncoderWeights(1)=0
I recieved this error
You cannot set the read-only property 'EncoderWeights' of Autoencoder.
So please I am looking for a way to accessing the weights of any neural network pretrrained model trained by Matlab.
1 Kommentar
cedric MAGUETA RUIVO
am 19 Aug. 2016
you can transform the autoencoder object into a neural network object with the network fonction and then use the IW and LW properties
net=network(autoenc);
net.IW{1}(1,1)=0; % set the first weigth of the first layer to zero
but with this methode ou can not more use the encode or decode function
Antworten (0)
Siehe auch
Kategorien
Mehr zu Define Shallow Neural Network Architectures finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!