How to store the randomly generated initial weights while using fitnet function of ANN toolbox?

1 view (last 30 days)
While using "fitnet" function of ANN toolbox, the initial weights are generated by this function itself and that doesn’t appear anywhere. Can anyone suggest me how to store these randomly generated initial weights by fitnet function?
More specifically: "fitnet" function starts with Initial weights (at 0 epoch) to optimized weights (lets at 10th epochs) by using let’s say "traingdm". So I want to store Initial weights (at 0 epoch).
Thanks for your help....

Accepted Answer

Greg Heath
Greg Heath on 5 Feb 2015
Cut and paste into the command line:
[x,t] = simplefit_dataset;
net = fitnet(10); % Inputs and Outputs are NOT defined here
view(net)
WB = getwb(net) % Only net.b{1} = zeros(10,1)is defined
rng(4151941) % Initialize the RNG so that results can be duplicated
net = configure(net,x,t);% Now inputs and outputs are defined and ready to train
IW = net.IW{1,1}
b1 = net.b{1}
LW = net.LW{2,1}
b2 = net.b{2}
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (0)

Community Treasure Hunt

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

Start Hunting!