Bayesian regularization of neural network (Effective # param)

3 views (last 30 days)
I wrote a code to perform Bayesian regularization of neural network using the neural network material by Martin T Hagan.
My code gives similar results with that of matlab for performance, sum squared parameter, but fails to give the same value for Effective number of parameter.
The formular i used for effective number of parameter is n - 2(alpha * trace_of_inverse_of_hessian_matrix) as described in the book.
My question is: what equation or formular does matlab use in estimating the effective number of parameter?
  1 Comment
uhunoma
uhunoma on 19 Feb 2019
%%The matlab test to verify my code is given below:
x = -1:0.05:1;
t = sin(2*pi*x);% + 0.1*randn(size(x));
net = feedforwardnet(1,'trainbr');
net.trainParam.epochs = 1;
net.trainParam.mu = 0.01;
net = configure(net, x, t );
wb = getwb(net);
Nw=net.numWeightElements;
net = setwb(net,ones(Nw,1));
net.divideParam.trainRatio = 1;
net.divideParam.valRatio = 0;
net.divideParam.testRatio = 0;
net.iw{1,1}
net.b{1}
net.layers{1}.transferFcn = 'logsig';
net.layers{2}.transferFcn = 'logsig';
net = train(net,x,t)

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!