Modifing the weights of neural network by setting some weughts to zero
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
cedric MAGUETA RUIVO
2016-8-19
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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!