How to input initial range of weights in the program code
Show older comments
I am using Matlab 2007a for training my FFNN. Codes are attached here. I have got 4 input nodes and 1 output node. I have selected 8 hidden nodes. how to select the initial weight range for each run? otherwise if i have trained a set using lr-0.9, mc-0.9, it will randomly take a series of weights and if i wanted to change mc keeping constant all other parameters, at that time, training will start with some other sets of weights. so i wanted to keep my initial weight values in the range of -0.5 to 0.5 in all the layers. how to incorporate that in the current program. I will really appreciate it if anyone can help me with this issue
net=newff(minmax(A),[4,8,1],{'logsig','logsig','purelin'},'trainlm'); net.performFcn = 'mse'; net=init(net);
net.trainParam.goal = 1e-4; net.trainParam.min_grad = 1e-20; net.trainParam.epochs = 5000; net.trainFcn = 'trainlm' ; net.trainParam.show = inf; net.trainParam.lr = 0.9; net.trainParam.mc = 0.9; net.trainParam.max_fail = 4; net.trainParam.mem_reduc = 1; net.trainParam.min_grad = 1e-10; net.trainParam.mu = 0.001; net.trainParam.mu_dec = 0.1; net.trainParam.mu_inc = 10; net.trainParam.mu_max = 1e10; net.trainParam.time = inf; net=train(net,A,B);
z=sim(net,A);
Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!